[ 
https://issues.apache.org/jira/browse/SSHD-942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16935611#comment-16935611
 ] 

David Ostrovsky commented on SSHD-942:
--------------------------------------

{quote}
I added a ChannelIdTrackingUnknownChannelReferenceHandler implementation in the 
sshd-contrib package that behaves along the lines I have suggested.
{quote}

Thanks, this is very much appreciated. I tried to borrow the 
{{ChannelIdTrackingUnknownChannelReferenceHandler}} from this CL: [1], but it 
doesn't build here, as the class 
{{org.apache.sshd.common.AttributeRepository.AttributeKey}}
is package protected. Here is the CL: [2]. The compilation error is:

{noformat}
ERROR: /home/davido/projects/gerrit2/java/com/google/gerrit/sshd/BUILD:3:1: 
Building java/com/google/gerrit/sshd/libsshd.jar (101 source files) and running 
annotation processors (AutoAnnotationProcessor, AutoValueProcessor) failed 
(Exit 1)
java/com/google/gerrit/sshd/ChannelIdTrackingUnknownChannelReferenceHandler.java:24:
 error: package org.apache.sshd.common.AttributeRepository does not exist
import org.apache.sshd.common.AttributeRepository.AttributeKey;
                                                 ^
java/com/google/gerrit/sshd/ChannelIdTrackingUnknownChannelReferenceHandler.java:45:
 error: cannot find symbol
    public static final AttributeKey<Integer> LAST_CHANNEL_ID_KEY = new 
AttributeKey<>();
                        ^
  symbol:   class AttributeKey
  location: class ChannelIdTrackingUnknownChannelReferenceHandler
Target //java/com/google/gerrit/sshd:sshd failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 74.740s, Critical Path: 58.61s
INFO: 345 processes: 331 remote cache hit, 4 linux-sandbox, 10 worker.
FAILED: Build did NOT complete successfully
{noformat}

Another question is: would it be possible to ship the new 
{{ChannelIdTrackingUnknownChannelReferenceHandler}}
in regular SSHD artifact, in {{sshd-common}}? That way it would be much easier 
to consume, and replace currently
used {{DefaultUnknownChannelReferenceHandler}} with only one single LoC? Right 
now Gerrit Code Review doesn't
consume sshd-contrib project and I would rater not add it as transitive 
dependency to Gerrit project.

[1] 
https://github.com/apache/mina-sshd/commit/11b33dee37b5b9c71a40a8a98a42007e3687131e



> SSH session crashes on high latency network
> -------------------------------------------
>
>                 Key: SSHD-942
>                 URL: https://issues.apache.org/jira/browse/SSHD-942
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 1.7.0, 2.0.0, 2.3.0
>            Reporter: David Ostrovsky
>            Assignee: Goldstein Lyor
>            Priority: Major
>
> Gerrit users report problem: [1] with {{git clone/fetch/pull}} operations on 
> high latency network, after upgrading Gerrit to 2.16.x from 2.15.x that 
> effectively means upgrade of SSHD from 1.6.0 to 1.7.0 and to 2.0.0.
> The error on SSHD 2.0.0 (Gerrit 2.16) is:
> {noformat}
> [2019-09-16 10:27:14,256] [sshd-SshServer[24facb47]-nio2-thread-8] WARN 
> org.apache.sshd.server.session.ServerSessionImpl : 
> exceptionCaught(ServerSessionImpl[usexxx@/172.x.x.1:63306])[state=Opened] 
> SshChannelNotFoundException: Received SSH_MSG_CHANNEL_WINDOW_ADJUST on 
> unknown channel 0
> {noformat}
> Note that the attempt to upgrade SSHD in Gerrit to 2.3.0 in this CL: [2], 
> didn't fix the problem:
> {noformat}
> [2019-09-17 14:05:27,923] [sshd-SshDaemon[189c6683](port=22)-nio2-thread-4] 
> WARN org.apache.sshd.server.session.ServerSessionImpl : 
> exceptionCaught(ServerSessionImpl[<username>@/<ip>:55212])[state=Opened] 
> SshChannelNotFoundException: Received SSH_MSG_CHANNEL_WINDOW_ADJUST on 
> unknown channel 3
> [2019-09-17 14:05:27,924] [SSH git-upload-pack <repo> (<username>)] ERROR 
> com.google.gerrit.sshd.BaseCommand : Internal server error (user <username> 
> account 1000190) during git-upload-pack '<repo path>'
> org.apache.sshd.common.channel.WindowClosedException: Already closed: 
> Window[server/remote](ChannelSession[id=2, 
> recipient=6]-ServerSessionImpl[<username>@/<ip>:55212])
>  at org.apache.sshd.common.channel.Window.waitForCondition(Window.java:302)
>  at org.apache.sshd.common.channel.Window.waitForSpace(Window.java:252)
> {noformat}
> Also note, that downgrade to 1.7.0: [3] didn't fix the problem either. Only 
> after downgrade to SSH 1.6.0: [4] the problem disappeared, and only warnings 
> left in the log:
> {noformat}
> [2019-09-18 09:24:52,755] [NioProcessor-2] WARN 
> org.apache.sshd.server.session.ServerConnectionService : Received 
> SSH_MSG_CHANNEL_CLOSE on unknown channel 12
> [2019-09-18 09:24:52,756] [NioProcessor-2] WARN 
> org.apache.sshd.server.session.ServerConnectionService : Received 
> SSH_MSG_CHANNEL_CLOSE on unknown channel 13
> [2019-09-18 09:25:02,576] [NioProcessor-2] WARN 
> org.apache.sshd.server.session.ServerConnectionService : Received 
> SSH_MSG_CHANNEL_CLOSE on unknown channel 15
> [2019-09-18 09:25:36,508] [NioProcessor-2] WARN 
> org.apache.sshd.server.session.ServerConnectionService : Received 
> SSH_MSG_CHANNEL_CLOSE on unknown channel 18
> [2019-09-18 09:25:57,527] [NioProcessor-2] WARN 
> org.apache.sshd.server.session.ServerConnectionService : Received 
> SSH_MSG_CHANNEL_CLOSE on unknown channel 19
> [2019-09-18 09:30:16,488] [NioProcessor-2] WARN 
> org.apache.sshd.server.session.ServerConnectionService : Received 
> SSH_MSG_CHANNEL_CLOSE on unknown channel 21
> {noformat}
> [1] 
> [https://bugs.chromium.org/p/gerrit/issues/detail?id=11491|https://bugs.chromium.org/p/gerrit/issues/detail?id=11491&;]
> [2] [https://gerrit-review.googlesource.com/c/gerrit/+/207752]
> [3] [https://gerrit-review.googlesource.com/c/gerrit/+/237730]
> [4] [https://gerrit-review.googlesource.com/c/gerrit/+/237731]



--
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

Reply via email to