You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2024/01/03 17:01:44 UTC

(camel) branch main updated: CAMEL-20225: use a monotonic clock in the BackOffTimerTask (#12642)

This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 9a7ac1d8a76 CAMEL-20225: use a monotonic clock in the BackOffTimerTask (#12642)
9a7ac1d8a76 is described below

commit 9a7ac1d8a76918b4ec57b242076d86bec6a9fda1
Author: Otavio Rodolfo Piske <or...@users.noreply.github.com>
AuthorDate: Wed Jan 3 14:01:38 2024 -0300

    CAMEL-20225: use a monotonic clock in the BackOffTimerTask (#12642)
---
 .../src/main/java/org/apache/camel/util/backoff/BackOffTimerTask.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/camel-util/src/main/java/org/apache/camel/util/backoff/BackOffTimerTask.java b/core/camel-util/src/main/java/org/apache/camel/util/backoff/BackOffTimerTask.java
index 160a8b7cef7..a98390d01d7 100644
--- a/core/camel-util/src/main/java/org/apache/camel/util/backoff/BackOffTimerTask.java
+++ b/core/camel-util/src/main/java/org/apache/camel/util/backoff/BackOffTimerTask.java
@@ -142,7 +142,7 @@ final class BackOffTimerTask implements BackOffTimer.Task, Runnable {
     public void run() {
         if (status == Status.Active) {
             try {
-                lastAttemptTime = System.currentTimeMillis();
+                lastAttemptTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime());
                 if (firstAttemptTime < 0) {
                     firstAttemptTime = lastAttemptTime;
                 }