-
Notifications
You must be signed in to change notification settings - Fork 144
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
Reset the sequence numbers on Session disconnect to support reconnection #409
Reset the sequence numbers on Session disconnect to support reconnection #409
Conversation
e91a9a7
to
04cc27c
Compare
Can also be reproduced by changing any of the Algorithms IT to do : try {
session.connect(timeout);
assertTrue(session.isConnected());
// Verify reconnect
session.disconnect();
session.connect(timeout);
assertTrue(session.isConnected());
} finally {
session.disconnect();
} |
751029b
to
7643815
Compare
7643815
to
d299535
Compare
String pubkeyAcceptedAlgorithms = session.getConfig("PubkeyAcceptedAlgorithms") + ",ssh-rsa"; | ||
session.setConfig("server_host_key", serverHostKey); | ||
session.setConfig("PubkeyAcceptedAlgorithms", pubkeyAcceptedAlgorithms); | ||
doSftp(session, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should wrap this in a assertDoesNotThrow()
to emphasize that we expect this to succeed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test already fails if an Exception is thrown, so right now it is indeed implied. Let me know if you want that changed or not , i don't really see that as a common pattern in the current ITs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't be surprised if the intention was for the Session object to not be reusable to create a new connection after the disconnect method has been called. Why not instead simply create a new Session object instead of trying to reuse the existing one?
Also considering this isn't a regression per se (since JSch has behaved in this manner for years), I would lean more towards not merging this in, since there is always a chance that this could instead introduce a some other new regression of some sort instead.
@mwiede what do you think?
I understand your position on this change, however the reason for introducing this is that the Session already resets the On another note, allowing a client to call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel strongly enough about this to block it, as long as @mwiede is also ok with it.
we do not really know, whether the Session was intened for re-use or not, but I think we can accept this change, because it also cannot be seen in the code, that reuse has to be blocked. |
Resolves #408