gnodet-bot commented on code in PR #28382:
URL: https://github.com/apache/camel/pull/28382#discussion_r4367526352
##########
core/camel-core-processor/src/main/java/org/apache/camel/processor/TotalRequestsThrottler.java:
##########
@@ -161,7 +162,7 @@ public boolean process(final Exchange exchange, final
AsyncCallback callback) {
if (state == State.ASYNC) {
if (LOG.isTraceEnabled()) {
- long queuedTime = System.currentTimeMillis() -
queuedStart;
+ long queuedTime = TimeSource.currentTimeMillis() -
queuedStart;
Review Comment:
⚠️ **Pre-existing bug (not introduced by this PR, mechanically preserved):**
`queuedStart` is read from `PROPERTY_EXCHANGE_QUEUED_TIMESTAMP`, which is set
to `TimeSource.nanoTime()` (nanoseconds) at line 196 in
`processAsynchronously`. Subtracting it from `TimeSource.currentTimeMillis()`
(milliseconds) produces a nonsensical result — `queuedTime` will be billions of
milliseconds. Worth fixing in a follow-up: either store `currentTimeMillis()`
at the timestamp property, or use `nanoTime()` for both sides of the
subtraction and convert to ms.
--
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]