Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ieof packet referred to nonexistent channel #805

Closed
realliujiaxu opened this issue Aug 25, 2022 · 0 comments
Closed

ieof packet referred to nonexistent channel #805

realliujiaxu opened this issue Aug 25, 2022 · 0 comments

Comments

@realliujiaxu
Copy link

In my project, I have logic like this:

  SSHClient sshClient = new SSHClient();
  sshClient.addHostKeyVerifier(new PromiscuousVerifier());
  sshClient.connect("host");
  sshClient.authPassword("xxx", "xxx");

  for (int i = 0; i < 100; i++) {
      try (Session sshSession = sshClient.startSession()) {
          Session.Command sshCommand = sshSession.exec("echo hello");
          IOUtils.readFully(sshCommand.getInputStream());
      }
  }

  sshClient.disconnect();

However, this throws IOException "ieof packet referred to nonexistent channel", especially when connecting localhost and running in parallel after I upgrade sshj from 0.31 to 0.32.

kegelh added a commit to kegelh/sshj that referenced this issue Sep 15, 2022
…isOpen and a Transport.write call

Otherwise, a disconnect with a "packet referred to nonexistent channel" message can occur.

This particularly happens when the transport.Reader thread passes an eof from the server to the ChannelInputStream, the reading library-user thread returns, and closes the channel at the same time as the transport.Reader thread receives the subsequent CHANNEL_CLOSE from the server.
kegelh added a commit to kegelh/sshj that referenced this issue Sep 16, 2022
…isOpen and a Transport.write call

Otherwise, a disconnect with a "packet referred to nonexistent channel" message can occur.

This particularly happens when the transport.Reader thread passes an eof from the server to the ChannelInputStream, the reading library-user thread returns, and closes the channel at the same time as the transport.Reader thread receives the subsequent CHANNEL_CLOSE from the server.
kegelh added a commit to kegelh/sshj that referenced this issue Sep 16, 2022
…isOpen and a Transport.write call

Otherwise, a disconnect with a "packet referred to nonexistent channel" message can occur.

This particularly happens when the transport.Reader thread passes an eof from the server to the ChannelInputStream, the reading library-user thread returns, and closes the channel at the same time as the transport.Reader thread receives the subsequent CHANNEL_CLOSE from the server.
kegelh added a commit to kegelh/sshj that referenced this issue Sep 16, 2022
…isOpen and a Transport.write call

Otherwise, a disconnect with a "packet referred to nonexistent channel" message can occur.

This particularly happens when the transport.Reader thread passes an eof from the server to the ChannelInputStream, the reading library-user thread returns, and closes the channel at the same time as the transport.Reader thread receives the subsequent CHANNEL_CLOSE from the server.
kegelh added a commit to kegelh/sshj that referenced this issue Sep 17, 2022
kegelh added a commit to kegelh/sshj that referenced this issue Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant