Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.3.0
-
None
-
Important
Description
There are some race conditions so that in port forwarding mode, not all messages are correctly managed during connections phase, leading to NullPointerException
The problem is caused in
DefaultForwardingFilter.messageReceived
where
OpenFuture future = channel.getOpenFuture(); Consumer<Throwable> errHandler = future.isOpened() ? null : e -> { try { exceptionCaught(session, e); } catch (Exception err) { log.warn("messageReceived({}) failed ({}) to signal {}[{}] on channel={}: {}", session, err.getClass().getSimpleName(), e.getClass().getSimpleName(), e.getMessage(), channel, err.getMessage()); } }; ClientChannelPendingMessagesQueue messagesQueue = channel.getPendingMessagesQueue();
should be
ClientChannelPendingMessagesQueue messagesQueue = channel.getPendingMessagesQueue(); OpenFuture future = messagesQueue.getCompletedFuture(); Consumer<Throwable> errHandler = future.isOpened() ? null : e -> { try { exceptionCaught(session, e); } catch (Exception err) { log.warn("messageReceived({}) failed ({}) to signal {}[{}] on channel={}: {}", session, err.getClass().getSimpleName(), e.getClass().getSimpleName(), e.getMessage(), channel, err.getMessage()); } };
Since the ClientChannelPendingMessagesQueue is a listener of the channel's OpenFuture, this latter can be in open state but the ClientChannelPendingMessagesQueue's completed feature could be not, so that messages won't be correctly handled and a null errHandler is passed to ClientChannelPendingMessagesQueue.handleIncomingMessage
Attachments
Issue Links
- links to