Hello Everybody,
we implemented a multithread scheduler in order to run many SFTP connections (one for each customer). We use these connections to upload /download files from/to remote servers.
Inside the scheduler, we use a ScheduledThreadPoolExecutor to run our SFTP connections (about 50). We run one thread (which instantiates an JSch object and Session object) for each SFTP connection.
Sometimes, one of those connections tries to connect to the SFTP server and the method session.connect() hangs without any timeout. No logs. No server response.
The connection is blocked as well as the whole JVM.
We needed to restart the service to fix the production.
We already checked the following points during the issue:
Thanks in advance,
Simone
We also experienced that session.connect() hangs indefinitely (with versions 0.1.49 and 0.1.55)
before connect() the timeout was set (with session.setTimeout()) but this timeout has no effect during the authentication in connect()
We did find a workaround (by configuring a different order of authentication methods) but the issue of hanging should be addressed nevertheless.
Our suggestion: the configured session timeout should also terminate long connect() or there need to be another possibility to configure authentication timeout explicitly.
Last edit: Eugen 2021-04-13