-
Notifications
You must be signed in to change notification settings - Fork 150
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
Random SFTP connection attempts gets stuck #329
Comments
Hi @alexndr79,
Thanks, |
Hi @norrisjeremy! Thanks for getting involved.
/Alex |
Hi @alexndr79, Are you calling Thanks, |
We're setting /Alex |
Hi @alexndr79, Do you see any Java thread besides the Also, would it be possible for you to share some code snippets of depicting how you are creating sessions and interacting with the SFTP channels? Also, when these hangs occur, can you capture output of Thanks, |
Hi @norrisjeremy ! I will gladly pull what I can the beginning of next week. Thanks for your support. .. one additional piece of information that could be useful, we're using a quite old JRE, OpenJDK8 jre8u345. /A /Alex |
No, other threads stuck in Here are some snippets describing our usage. We have wrapped session/channel creation in an FtpConnection- class (presented here somewhat as pseudo- code, I have removed some parts to make everything a little more clear). This class is instantiated for every FTP connection attempt, and we can potentially do several of these to the same server concurrently (different ftp user though). And I earlier mentioned that we use 60s timeout but seems to be 30s.
We then have another class initiating the connection and doing the actual downloads
|
Hi @alexndr79, So just to confirm, the stuck connections you see always occur when calling Thanks, |
Hi @alexndr79, Also, have you attempted to enable JSch logging to see if anything interesting is logged whenever these connections get stuck? Thanks, |
Hi! @norrisjeremy ! Correct, always at We haven't seen the issue for 2 weeks now but back then we had it once per day for three straight days so very random. I'll try to get hold of the other information requested. No, we have not enabled extended logging yet but it sounds like a good idea. I guess it's just a matter of defining a proper log level for /A |
Hi @alexndr79, We have several built-in loggers (depending upon the type of logging backend you use):
You can simply add a single call to Thanks, |
We're using AWS SSH SFTP. Remote string says We have checked SFTP server logs but couldn't see any apparent issues. We have enabled detailed JSch- logging now so let's see if that will give us anything. Thanks! |
Hi @alexndr79, How many simultaneous connections to the same server do you max at out? Thanks, |
Hi @norrisjeremy ! We make max 10 concurrent connections to the same server from this JVM. /Alex |
Hi @alexndr79, And just to confirm, you are using the AWS Transfer Service based SFTP server? And do you back this with S3 or EFS? Sorry for all the detailed questions: I'm trying to determine if there could be a a way to easily replicate this issue. Thanks, |
Hi @norrisjeremy! Yes, AWS Transfer Service based SFTP server, backed by S3. /A |
Hi @alexndr79, Ok, thanks. The call to Additionally, in a bizarre twist, the SSH server appears to remain responsive in so much as that it would seem to still be responding to periodic keepalives being generated by the ServerAliveInterval, else the Your best bet may simply be to wrap the call to
Thanks, |
Ok, thanks for you support @norrisjeremy. We will check the logs if we see the hang again and maybe, in the end, go for the solution suggested above. Thanks! |
Hi again, This weekend we faced the issue again. This is what we could see in the logs: ... Our own logging the revealed at 20:09:10 that we tried to connect to the channel and it then got stuck. Nothing more logged from JSch after 20:09:10. We will now try the async wrapper approach which should work I guess. Thanks. /A |
The suggested work around seems to work well for us. Thanks for your support @norrisjeremy! |
We're seeing random SFTP connection attempts that get stuck forever at:
We've set the session timeout (using
session.setTimeout(60000)
) and we use timeout when opening the connection (session.connect(60000)
). We're opening several parallell connections to same server, different sessions, if that can add some value to understanding the issue.We've looked on this similar issue #54 but we don't have anything going on in the session thread so it feels unrelated:
We're using latest release 0.2.8. Problem appears a couple of times every month for a job scheduled to run every minute 24-7.
The text was updated successfully, but these errors were encountered: