https://github.com/elastic/elasticsearch/blob/099fb84cfcf87be6689c3516674f45438bafa767/server/src/main/java/org/elasticsearch/action/ActionListener.java#L420-L432

Rather than keeping hold of the `delegate` and using an `AtomicBoolean` to track the completion, we could use an `AtomicReference` and drop the whole listener on completion, which might free up heap in some fail-fast cases.
server/src/main/java/org/elasticsearch/discovery/HandshakingTransportAddressConnector.java
Locale.ROOT,
                                                """
                                                    successfully discovered master-ineligible node %s at [%s]; to suppress this message, \
                                                    remove address [%s] from your discovery configuration or ensure that traffic to this \
                                                    address is routed only to master-eligible nodes""",
                                                remoteNode.descriptionWithoutAttributes(),
                                                transportAddress,
                                                transportAddress
                                            )
                                        )
                                    );
                                } else {
                                    transportService.connectToNode(remoteNode, new ActionListener<>() {
                                        @Override
                                        public void onResponse(Releasable connectionReleasable) {
                                            logger.trace("[{}] completed full connection with [{}]", transportAddress, remoteNode);
                                            listener.onResponse(new ProbeConnectionResult(remoteNode, connectionReleasable));
                                        }
                                        @Override
                                        public void onFailure(Exception e) {
                                            
                                            
                                            
                                            
                                            
                                            logger.warn(
                                                () -> format(
                                                    "completed handshake with [%s] at [%s] but followup connection to [%s] failed",
                                                    remoteNode.descriptionWithoutAttributes(),
                                                    transportAddress,