TerraNibble commented on issue #427:
URL: https://github.com/apache/mina-sshd/issues/427#issuecomment-1936026984

   With some further testing this appears to happen if we trigger the sending 
of an EOF too quickly after sending a stream. Placing a 100ms delay between 
these actions alleviates the issue and further demonstrates the race condition.
   
   ```java
           try {
               try (InputStream invOut = channel.getInvertedOut();
                    OutputStream invIn = channel.getInvertedIn()) {
                   // NOTE: we use a mock file system since we expect no 
invocations for it
                   ScpHelper helper = new ScpHelper(session, invOut, invIn, new 
MockFileSystem(remote), opener, listener);
                   Path mockPath = new MockPath(remote);
                   helper.sendStream(new DefaultScpStreamResolver(name, 
mockPath, perms, time, size, local, cmd),
                           options.contains(Option.PreserveAttributes), 
ScpHelper.DEFAULT_SEND_BUFFER_SIZE);
                   Thread.sleep(100);
               }
               handleCommandExitStatus(cmd, channel);
           } catch (InterruptedException e) {
               throw new RuntimeException(e);
           } finally {
               channel.close(false);
           }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to