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

   ## Summary
   
   Fix flaky test `SftpSimpleProduceDisconnectIT` in both `camel-ftp` and 
`camel-mina-sftp` by adding `disconnect=true` to the SFTP producer URIs.
   
   ## Root Cause
   
   The test verifies that an SFTP producer can still upload a file after the 
server is restarted. Without `disconnect=true`, the `DefaultProducerTemplate` 
caches the producer and reuses its JSch/MINA SSH session across sends. After 
`service.tearDownServer()` + `service.setUpServer()`, that cached session is 
stale.
   
   The race: `sendNoop()` (used to check connection liveness) can falsely 
return success because the TCP RST from the server shutdown may not have been 
received yet. The session appears alive, so no reconnect is attempted — but the 
next actual channel operation (the SFTP `put`) fails with `Broken pipe`.
   
   ## Fix
   
   Add `disconnect=true` to both SFTP URIs in each test (first and second 
send). This forces the producer to disconnect after every send, so the second 
upload always opens a fresh connection to the restarted server.
   
   The fix is applied to the twin test in `camel-mina-sftp` for the same reason.
   
   ## Tests
   
   Both `SftpSimpleProduceDisconnectIT` tests (camel-ftp and camel-mina-sftp) 
pass locally.
   
   Fixes CAMEL-27277
   
   ---
   _Hermes Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet_
   


-- 
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