[ https://issues.apache.org/jira/browse/KAFKA-7518?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16655039#comment-16655039 ]
ASF GitHub Bot commented on KAFKA-7518: --------------------------------------- akatona84 opened a new pull request #5815: KAFKA-7518: FutureRecordMetadata.get deadline calculation fix URL: https://github.com/apache/kafka/pull/5815 *More detailed description of your change, if necessary. The PR title and PR message become the squashed commit message, so use a separate comment to ping reviewers.* *Summary of testing strategy (including rationale) for the feature or bug fix. Unit and/or integration tests are expected for any behaviour change and system tests should be considered for larger changes.* ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > FutureRecordMetadata.get deadline calculation from timeout is not using > timeunit > -------------------------------------------------------------------------------- > > Key: KAFKA-7518 > URL: https://issues.apache.org/jira/browse/KAFKA-7518 > Project: Kafka > Issue Type: Bug > Components: clients > Reporter: Andras Katona > Assignee: Andras Katona > Priority: Major > > Code below assumes that timeout is in milliseconds when calculating deadline. > {code} > @Override > public RecordMetadata get(long timeout, TimeUnit unit) throws > InterruptedException, ExecutionException, TimeoutException { > // Handle overflow. > long now = System.currentTimeMillis(); > long deadline = Long.MAX_VALUE - timeout < now ? Long.MAX_VALUE : now > + timeout; > {code} > It was causing > {{kafka.server.DynamicBrokerReconfigurationTest#testAdvertisedListenerUpdate}} > to fail sometimes and it took me to this code segment. -- This message was sent by Atlassian JIRA (v7.6.3#76005)