When a unicast request is received before the first view is received (which sets the channel to connected), and a response to the request is sent, then the response sending throws an exception as the channel hasn't yet been connected (see stack trace below).
What happens when a channel is created is:
- JChannel.connect() is called by the user
- As part of this, start() is called in every protocol
- UDP.start() creates the sockets and starts the socket listener which will receive messages from now on and pass them up
- Connect() now sends a JOIN request to the coordinator and receives the JOIN response or become singleton member
- In either case, a new view is installed, which sets the channel to connected
If, between starting the socket listener and setting the channel to connected, a unicast message is received, and it sends a response then you'll get the behavior below.
In NAKACK2, this doesn't happen, as all messages received in the same time frame are queued and replayed when the channel becomes connected.
I could implement the same behavior for UNICAST2, but I'd like to know more about how you got into this situation. What were the steps executed ?
The only way this could happen I can think of is that the coordinator sent a unicast message to P right after it sent the JOIN response to P, e.g. in the view change which includes P. Does this happen in Infinispan code ?
13:29:45,467 ERROR (OOB-1,ISPN,NodeB-50197 [UNICAST2] couldn't deliver OOB message [dst: NodeB-50197, src: NodeA-40526 (3 headers), size=118 bytes, flags=OOB|DONT_BUNDLE]
java.lang.IllegalStateException: channel is not connected