gnodet-bot commented on code in PR #30709:
URL: https://github.com/apache/camel/pull/30709#discussion_r4676892362
##########
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:
The comment's second paragraph says _"other failures (e.g. connection
refused via ConnectFuture) that should be retried"_, which reads as if
`ConnectFuture` is the only source of non-auth `SshException`s. However, the
`if` condition already catches **two** distinct auth-failure patterns from two
different call sites: `AuthFuture.verify()` → `"Authentication failed while
waiting N msec."` and `ClientUserAuthService.tryNext()` → `"No more
authentication methods available"`. The comment describes the first path
explicitly but is silent about the second. Suggested: extend the first
paragraph to name both sources, e.g.:
```
// SshException is thrown for two kinds of authentication failures:
// * AuthFuture.verify() — "Authentication failed while waiting N msec."
// * ClientUserAuthService.tryNext() — "No more authentication methods
available"
// In both cases the credentials are definitively rejected and retrying will
not help.
```
--
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]