Croway opened a new pull request, #30062:
URL: https://github.com/apache/camel/pull/30062

   Docs only. Describes how the FTP, FTPS and SFTP endpoints notice a server 
that stops answering, with the current behaviour. Fault-injection tests (a 
half-open connection to real FTP and SFTP servers) showed a consumer or 
producer waiting about 5 minutes per FTP command and about 10 minutes on SFTP 
with the defaults, a consumer health check that stays UP while the server 
cannot be reached, and a truncated file left under its final name after a 
broken upload.
   
   **ftp-component.adoc**, section "About timeouts" rewritten (it said that 
SFTP uses `connectTimeout` as its `soTimeout`, which the code does not do): a 
table of `connectTimeout`, `soTimeout` and `timeout` and what each bounds, and 
three subsections:
   - "Noticing a dead or silent server": the 5-minute `soTimeout` wait per 
command (including the pre-upload `NOOP`), an example with lower timeouts, and 
`throwExceptionOnConnectFailed=true`, without which a failed connect is a 
skipped, successful poll and the health check stays UP;
   - "Uploads interrupted by a broken connection": `tempPrefix` / 
`tempFileName`;
   - "Transfer mode": ASCII by default, `binary=true` for files that are not 
text.
   
   **sftp-component.adoc**, new section "Timeouts and dead connections": 
`soTimeout` is the JSch session read timeout; JSch sends a keep-alive on the 
first timeout and drops the session after `serverAliveCountMax` unanswered 
ones, so a half-open connection takes about 2 × `soTimeout`; 
`serverAliveInterval` replaces `soTimeout` when set. It is a separate section, 
away from the host key, algorithm and authentication sections.
   
   Checked against the sources at the versions on `main`: Apache Commons Net 
3.13.0 (`FTPClient`, `SocketClient`), JSch 2.28.8 (`Session.run`, `setTimeout`, 
`setServerAliveInterval`, `sendKeepAliveMsg`), and Camel's `FtpEndpoint`, 
`FtpOperations`, `SftpOperations`, `RemoteFileConsumer.prePollCheck`, 
`RemoteFileProducer.handleFailedWrite`, `GenericFileProducer` and 
`ScheduledPollConsumer`. The durations are given as approximate behaviour of 
the libraries. No code change; the catalog copies are regenerated.
   
   _Claude Code on behalf of Croway_
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to