lianetm commented on code in PR #14557: URL: https://github.com/apache/kafka/pull/14557#discussion_r1432774544
########## 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: I fixed the `getExpirationTimeForTimeout` (simply returning the max if it overflows to negative, as this timeout is always > 0, coming from a Duration object from the API calls). We need the same calculation when processing topicMetadata events [here](https://github.com/apache/kafka/blob/1b95d01e49d39927633720e31ecb0f9a6ce659c9/clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/ApplicationEventProcessor.java#L240) (I was intentionally keeping the logic similar for the 2 event that support timeouts for now), I would fix that one here too to use the same `getExpirationTimeForTimeout` if we're ok with it @AndrewJSchofield -- 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