gnodet commented on code in PR #30709:
URL: https://github.com/apache/camel/pull/30709#discussion_r4679870349
##########
components/camel-mina-sftp/src/main/java/org/apache/camel/component/file/remote/mina/MinaSftpOperations.java:
##########
@@ -207,6 +208,25 @@ private boolean tryConnect(TaskPayload payload) {
LOG.debug("Connected to {}",
payload.configuration.remoteServerInformation());
}
}
+ } catch (SshException e) {
+ // SshException is thrown by AuthFuture.verify() when the server
rejects the login
+ // ("Authentication failed while waiting N msec."). Unlike
transient I/O failures,
+ // a rejected login will not succeed on retry: the credentials are
wrong, the server
+ // may lock the account after repeated failures. Rethrow
immediately so the reconnect
+ // loop does not keep sending the bad credentials on each attempt.
+ //
+ // SshException is also thrown for other failures (e.g. connection
refused via
+ // ConnectFuture) that should be retried; check the message to
tell them apart.
Review Comment:
Fixed — the comment now documents both sources precisely:
- `ClientUserAuthService.tryNext()` carries disconnect code
`SSH2_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE` (14) and is now detected via
`e.getDisconnectCode()` rather than string matching.
- `DefaultAuthFuture.verify()` (seeing `false`) carries no disconnect code
but the message contains "Authentication failed" — still covered by the string
check.
The "ConnectFuture" mention is gone; the comment lists both paths explicitly.
_Hermès on behalf of gnodet_
--
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]