[jira] [Updated] (SSHD-961) Not all messages are correctly handled in port forwarding mode

2019-12-24 Thread Lyor Goldstein (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lyor Goldstein updated SSHD-961:

Affects Version/s: (was: 2.3.1)
   2.3.0

> Not all messages are correctly handled in port forwarding mode
> --
>
> Key: SSHD-961
> URL: https://issues.apache.org/jira/browse/SSHD-961
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.3.0
>Reporter: Fulvio Cavarretta
>Assignee: Lyor Goldstein
>Priority: Major
> Fix For: 2.3.1
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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 
> {noformat}
> DefaultForwardingFilter.messageReceived{noformat}
>  where
> {code:java}
> OpenFuture future = channel.getOpenFuture();
> Consumer 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();
> {code}
> should be 
> {code:java}
> ClientChannelPendingMessagesQueue messagesQueue = 
> channel.getPendingMessagesQueue();
> 
> OpenFuture future = messagesQueue.getCompletedFuture();
> Consumer 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());
> }
> };
> {code}
> 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_
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Resolved] (SSHD-961) Not all messages are correctly handled in port forwarding mode

2019-12-24 Thread Lyor Goldstein (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lyor Goldstein resolved SSHD-961.
-
Fix Version/s: 2.3.1
   Resolution: Fixed

Merged in with thanks + acknowledgement - see 
[commit|https://github.com/apache/mina-sshd/commit/3eeaa03a20b849da8c6e59bfa97534f6bb15bebb]

> Not all messages are correctly handled in port forwarding mode
> --
>
> Key: SSHD-961
> URL: https://issues.apache.org/jira/browse/SSHD-961
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.3.1
>Reporter: Fulvio Cavarretta
>Assignee: Lyor Goldstein
>Priority: Major
> Fix For: 2.3.1
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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 
> {noformat}
> DefaultForwardingFilter.messageReceived{noformat}
>  where
> {code:java}
> OpenFuture future = channel.getOpenFuture();
> Consumer 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();
> {code}
> should be 
> {code:java}
> ClientChannelPendingMessagesQueue messagesQueue = 
> channel.getPendingMessagesQueue();
> 
> OpenFuture future = messagesQueue.getCompletedFuture();
> Consumer 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());
> }
> };
> {code}
> 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_
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org