AndrewJSchofield commented on code in PR #14557:
URL: https://github.com/apache/kafka/pull/14557#discussion_r1432721019


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/ApplicationEventProcessor.java:
##########
@@ -272,6 +280,10 @@ private void process(final LeaveOnCloseApplicationEvent 
event) {
         event.chain(future);
     }
 
+    private long getExpirationTimeForTimeout(final long timeoutMs) {
+        return (timeoutMs == Long.MAX_VALUE) ? Long.MAX_VALUE : 
System.currentTimeMillis() + timeoutMs;

Review Comment:
   There's a problem with this method. If the remaining time for the timeout is 
less than MAX_VALUE, but it was originally initialised from Long.MAX_VALUE, you 
get an arithmetic overflow here. That is of course a large negative number and 
things time out very enthusiastically.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to