Background: I was analysing JIRA issues related to the NIOHub fatal channel termination causing massive disconnection of agents. It appears that the SingleLaneExecutor is not completely correctly used there...
TL;DR: A single packet sent to the channel with pending shutdown may cause the termination of all remoting channels in JNLP1, JNLP2, CLI, and CLI2 protocols. JNLP4 does not seem to be affected.
- When we receive the command in a particular NioTransport, message parts are are being submitted to its SingleLaneExecutor
- If the executor service rejects the task (e.g. due to the pending shutdown), a runtime RejectedExecutionException is being thrown. E.g. here
- This exception is not being caught on the NioTransport level and gets proparated to the top level of NioChannelHub#run()
- NioChannelHub#run() catches the unhandled RuntimeException... and terminates the entire NioHub.