Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
SFTP File Reader gets stuck in Polling state. Must be halted and restarted. #4142
See forum post https://www.mirthcorp.com/community/forums/showthread.php?t=11371 for history of issue.
All of the seemingly unrelated errors have to do with the server terminating the connection. My thread dump showed that the Jsch session thread was not running when the channel was stuck polling.
After 8 occurances of these errors is when the channel gets stuck. org.apache.commons.pool2.impl.GenericObjectPoolConfig.DEFAULT_MAX_TOTAL is also 8.
The issue appears to be in the releaseConnection method of com.mirth.connect.connectors.file.FileConnector. If the FileSystemConnection is not connected, it neither returns it to the pool nor invalidates it.
I was able to verify this with the following code:
Imported Issue. Original Details:
Surefire way to reproduce:
Setup an SFTP container:
Create a File Writer to write to it:
Set a breakpoint at FileDispatcher:166, right after the line
On the 9th time, the breakpoint won't be reached, and instead your File Writer will be hung until you halt it. Verify with a threaddump:
Imported Comment. Original Details: