Details
Description
Problem appear if somebody kill logged on user on sftp server while you are connected with consumer.
Camel is not able to reconnect on next poll even if it says that it will do this.
RemoteFileConsumer is not connected but it thinks that it is still logged in.
I think "loggedIn" flag should be down after each disconnecting action like in attached patch.
2011-07-24 22:35:14,848 WARN [RemoteFilePollingConsumerPollStrategy:37] Trying to recover by disconnecting from remote server forcing a re-connect at next poll: sftp://test@host
2011-07-24 22:35:14,849 WARN [RemoteFilePollingConsumerPollStrategy:52] Consumer Consumer[sftp://test@host/test?delay=60000&delete=true&localWorkDirectory=%2Fvar%2Ftest%2Ftemp&password=xxxx&throwExceptionOnConnectFailed=true] could not poll endpoint: sftp://test@host/test?delay=60000&delete=true&localWorkDirectory=%2Fvar%2Ftest%2Ftemp&password=xxxx&throwExceptionOnConnectFailed=true caused by: Cannot change directory to: test
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot change directory to: test
at org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:408)
at org.apache.camel.component.file.remote.SftpOperations.changeCurrentDirectory(SftpOperations.java:393)
at org.apache.camel.component.file.remote.SftpConsumer.doPollDirectory(SftpConsumer.java:77)
at org.apache.camel.component.file.remote.SftpConsumer.pollDirectory(SftpConsumer.java:49)
at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:83)
at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:97)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: 4:
at com.jcraft.jsch.ChannelSftp.cd(ChannelSftp.java:285)
at org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:406)
... 14 more
Caused by: java.io.IOException: Pipe closed
at java.io.PipedInputStream.read(PipedInputStream.java:291)
at java.io.PipedInputStream.read(PipedInputStream.java:361)
at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java:2333)
at com.jcraft.jsch.ChannelSftp.header(ChannelSftp.java:2359)
at com.jcraft.jsch.ChannelSftp._realpath(ChannelSftp.java:1819)
at com.jcraft.jsch.ChannelSftp.cd(ChannelSftp.java:268)
... 15 more