I'm finally transitioning to using provisiond for discovery but am not able to reliably detect services. On my test system I'm trying to detect services on a single node that has ping, SSH, HTTP on port 80, HTTPS on 443 and another HTTPS service on port 8443. After creating a prov req, I add an HTTPS service to the list of detectors in the foreign source definition with a port parameter of 8443, leaving the default detectors in tact. Clicking the synchronize button fires off discovery but only ICMP and SSH get detected - bumping up the logs for Provisiond to DEBUG shows that all other services are detecting false with a stack trace like this in the log:
2014-02-18 22:30:55,536 DEBUG [NioSocketConnector-2] ConnectionFactoryNewConnectorImpl$1: Exception of type org.apache.mina.core.RuntimeIoException caught, disposing of connector: NioSocketConnector-2
org.apache.mina.core.RuntimeIoException: Failed to get the session.
Caused by: java.net.ConnectException: Connection timed out.
... 7 more
2014-02-18 22:30:55,537 INFO [NioSocketConnector-2] AsyncBasicDetectorMinaImpl$2: Connection exception occurred: java.net.ConnectException: Connection timed out. for service HTTP, retrying attempt 1
However, if I remove the detectors for the services that aren't on this node, the expected serviced do get detected properly. Also, since Provisiond seems to detect services in the same order as defined in the foreign source definition, if I remove them one-by-one previously failing services start getting detected as I remove services defined before it that I know will fail. Seems like all the NioSocketConnector instances are sharing a reference to something that prevents sessions from getting created once a single attempt times out.
Maybe somehow related to the fix for the leaking file descriptors utilizing the IoSessionInitializer callback but I don't know anything about MINA and I couldn't really find any good documentation or examples on it either.