-
Bug
-
Resolution: Done
-
Major
-
27.0.0.Beta1
-
None
-
-
---
-
---
e.g. after starting standalone-full-ha.xml, which will bind the server socket channel used by jgroups-udp-fd:
[standalone@embedded /] /socket-binding-group=standard-sockets/socket-binding=jgroups-udp-fd:read-resource(include-runtime=true) { "outcome" => "success", "result" => { "bound" => false, "bound-address" => undefined, "bound-port" => undefined, "client-mappings" => undefined, "fixed-port" => false, "interface" => "private", "multicast-address" => undefined, "multicast-port" => undefined, "name" => "jgroups-udp-fd", "port" => 54200 } }
In general, we register JGroups sockets with the socket binding registry via a custom JGroups SocketFactory. WildFly uses custom Socket, ServerSocket, DatagramSocket, MulticastSocket implementations in order to defer socket binding registration until the socket is bound and deregistration upon close().
Unfortunately, this mechanism does not work for NetworkChannels, since the implementations of these are specific to a SelectorProvider. However, we can register a short-lived Selector which defers registration with the socket binding registry until the first OP_CONNECT or OP_ACCEPT, at which point the channel should be bound, and thus registration can proceed. To avoid leaking socket binding registrations, we will need to track socket binding registrations for network channels separately, so that we can unregister on SocketFactory.close(SocketChannel) or close(ServerSocketChannel).