Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.6.0, 2.7.0
-
None
Description
I observe the following:
2021-04-30 17:03:39 DEBUG sshd-JGitSshClient[7c440ee8]-nio2-thread-3 ChannelExec:528 - handleClose(ChannelExec[id=0, recipient=0]-JGitClientSession[git@bitbucket.org/104.192.141.1:22]) SSH_MSG_CHANNEL_CLOSE 2021-04-30 17:03:39 DEBUG sshd-JGitSshClient[7c440ee8]-nio2-thread-3 ChannelExec:533 - handleClose(ChannelExec[id=0, recipient=0]-JGitClientSession[git@bitbucket.org/104.192.141.1:22]) prevent sending EOF 2021-04-30 17:03:39 DEBUG sshd-JGitSshClient[7c440ee8]-nio2-thread-3 ChannelExec:107 - close(ChannelExec[id=0, recipient=0]-JGitClientSession[git@bitbucket.org/104.192.141.1:22]) Closing gracefully 2021-04-30 17:03:39 DEBUG sshd-JGitSshClient[7c440ee8]-nio2-thread-3 ChannelExec:666 - close(ChannelExec[id=0, recipient=0]-JGitClientSession[git@bitbucket.org/104.192.141.1:22]) prevent sending EOF 2021-04-30 17:03:39 DEBUG sshd-JGitSshClient[7c440ee8]-nio2-thread-3 Window:356 - Closing Window[client/local](ChannelExec[id=0, recipient=0]-JGitClientSession[git@bitbucket.org/104.192.141.1:22]) 2021-04-30 17:03:39 DEBUG sshd-JGitSshClient[7c440ee8]-nio2-thread-3 Window:356 - Closing Window[client/remote](ChannelExec[id=0, recipient=0]-JGitClientSession[git@bitbucket.org/104.192.141.1:22]) 2021-04-30 17:03:39 DEBUG sshd-JGitSshClient[7c440ee8]-nio2-thread-3 ChannelExec:901 - sendEof(ChannelExec[id=0, recipient=0]-JGitClientSession[git@bitbucket.org/104.192.141.1:22]) SSH_MSG_CHANNEL_EOF (state=Graceful) 2021-04-30 17:03:39 DEBUG sshd-JGitSshClient[7c440ee8]-nio2-thread-3 JGitClientSession:1215 - encode(JGitClientSession[git@bitbucket.org/104.192.141.1:22]) packet #14 sending command=96[SSH_MSG_CHANNEL_EOF] len=5 2021-04-30 17:03:39 DEBUG sshd-JGitSshClient[7c440ee8]-nio2-thread-3 Nio2Session:171 - writeBuffer(Nio2Session[local=/192.168.2.83:58913, remote=bitbucket.org/104.192.141.1:22]) writing 68 bytes 2021-04-30 17:03:39 DEBUG sshd-JGitSshClient[7c440ee8]-nio2-thread-3 AbstractChannel$GracefulChannelCloseable:594 - close(ChannelExec[id=0, recipient=0]-JGitClientSession[git@bitbucket.org/104.192.141.1:22])[immediately=false] processing 2021-04-30 17:03:39 DEBUG sshd-JGitSshClient[7c440ee8]-nio2-thread-3 AbstractChannel$GracefulChannelCloseable:602 - close(ChannelExec[id=0, recipient=0]-JGitClientSession[git@bitbucket.org/104.192.141.1:22])[immediately=false] send SSH_MSG_CHANNEL_CLOSE 2021-04-30 17:03:39 DEBUG sshd-JGitSshClient[7c440ee8]-nio2-thread-3 JGitClientSession:1215 - encode(JGitClientSession[git@bitbucket.org/104.192.141.1:22]) packet #15 sending command=97[SSH_MSG_CHANNEL_CLOSE] len=5 2021-04-30 17:03:39 DEBUG sshd-JGitSshClient[7c440ee8]-nio2-thread-3 Nio2Session:171 - writeBuffer(Nio2Session[local=/192.168.2.83:58913, remote=bitbucket.org/104.192.141.1:22]) writing 68 bytes
- Client receives a SSH_MSG_CHANNEL_CLOSE from the server
- Client logs (twice) is wouldn't send an EOF
- Client sends SSH_MSG_CHANNEL_EOF all the same
- Client sends SSH_MSG_CHANNEL_CLOSE
In my reading of RFC 4254, section 5.3, this is wrong; the RFC says:
Upon receiving this message, a party MUST send back an SSH_MSG_CHANNEL_CLOSE unless it has already sent this message for the channel. [...] A party MAY send SSH_MSG_CHANNEL_CLOSE without having sent or received SSH_MSG_CHANNEL_EOF.
I take this to mean that on reception of a CLOSE one needs to reply CLOSE, not EOF followed by CLOSE.
IMO AbstractChannel.handleClose() should not call isEofSent() but use eofSent.getAndSet(true) instead to really prevent sending the EOF.
That code got changed in SSHD-836 (commit bba23bf70). What was the reason for that? gnodet, do you remember?
Attachments
Issue Links
- is caused by
-
SSHD-836 Make final some methods from base Closeable implementations
- Resolved