Croway commented on PR #30177:
URL: https://github.com/apache/camel/pull/30177#issuecomment-6915003741

   Thanks for the review. Both points are addressed in cf6685ae6e70.
   
   **`isConnected()` guard in the locked branch**: confirmed. After a connect 
that fails, `createSession()` has already created and started the `SshClient`, 
but no session is assigned, so `isConnected()` is false, and neither 
`handleFailedWrite()` (which also checks `isConnected()`) nor the stop stopped 
the client. The locked branch now calls `disconnect()` directly, as 
`SftpOperations.disconnectOnStop()` does.
   
   New `MinaSftpProducerStopAfterFailedConnectIT`: the embedded SSHD accepts 
only the right password and no public key (the MINA SSHD client also offers the 
user's `~/.ssh` keys, which the default test server accepts). An upload with a 
wrong password fails, the test checks that the `SshClient` of the operations is 
started, stops the producer, and then checks that the client is stopped and 
closed (`SshClient.stop()` waits for the close, so no polling is needed). It 
fails without the change ("The stop of the producer should stop the SSH 
client") and passes with it.
   
   **Wording**: the javadoc now says "when the producer or the consumer stops" 
and names the consumer's poll, and the WARN says "an upload or a download that 
hangs", as in `SftpOperations` on #30176. The mina-sftp consumer reaches 
`disconnectOnStop()` once #30176 is merged. This PR does not add an IT for the 
mina-sftp consumer path; it can be a follow-up.
   
   The unit tests (53) and all the ITs of camel-mina-sftp (315 + 24 serial), 
including `MinaSftpProducerStopDuringHungUploadIT` and 
`SftpDisconnectThreadLeakIT`, pass.
   
   _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