[
https://issues.apache.org/jira/browse/CAMEL-12850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16636342#comment-16636342
]
ASF GitHub Bot commented on CAMEL-12850:
----------------------------------------
GitHub user tadayosi opened a pull request:
https://github.com/apache/camel/pull/2545
CAMEL-12850: camel-ftp tries reconnects twice as much as maximumRecon…
…nectAttempts
https://issues.apache.org/jira/browse/CAMEL-12850
Sent the pull req for reviewing purposes at this moment. Please do not
merge this until we fully discuss it's a valid way to fix it.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tadayosi/camel CAMEL-12850
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/2545.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2545
----
commit 1cd4268a33e65657f82df9c415d9c25727cea737
Author: Tadayoshi Sato <sato.tadayoshi@...>
Date: 2018-10-03T02:07:22Z
CAMEL-12850: camel-ftp tries reconnects twice as much as
maximumReconnectAttempts
----
> camel-ftp tries reconnects twice as much as maximumReconnectAttempts
> --------------------------------------------------------------------
>
> Key: CAMEL-12850
> URL: https://issues.apache.org/jira/browse/CAMEL-12850
> Project: Camel
> Issue Type: Bug
> Components: camel-ftp
> Affects Versions: 2.22.1
> Reporter: Tadayoshi Sato
> Assignee: Tadayoshi Sato
> Priority: Major
> Attachments: FtpTimeoutWithMaximumReconnectAttemptsTest.java
>
>
> When {{maximumReconnectAttempts > 0}} on the endpoint, both camel-ftp
> consumers and producers retry connecting to an unavailable FTP server twice
> as much as the number of {{maximumReconnectAttempts}}. It is because of the
> following logic in {{RemoteFileConsumer.prePollCheck()}} and
> {{RemoteFileProducer.preWriteCheck()}}:
> {code:java}
> if (getEndpoint().getMaximumReconnectAttempts() > 0) {
> // only use recoverable if we are allowed any re-connect
> attempts
> recoverableConnectIfNecessary();
> } else {
> connectIfNecessary();
> }
> {code}
> where {{recoverableConnectIfNecessary()}} retries
> {{RemoteFileOperations.connect()}} once in case of initial connection failure.
> Digging into the commit history, this logic appears to be introduced due to
> CAMEL-2829 as a workaround. However, since the root cause NET-327 is already
> resolved the logic doesn't seem to be necessary any more. So probably we can
> remove the logic to avoid attempting reconnects twice as much as
> {{maximumReconnectAttempts}}.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)