Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-7518

FutureRecordMetadata.get deadline calculation from timeout is not using timeunit

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.2.0, 2.1.1
    • clients
    • None

    Description

      Code below assumes that timeout is in milliseconds when calculating deadline.

          @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;
      

      kafka.server.DynamicBrokerReconfigurationTest#testAdvertisedListenerUpdate failed sometimes for me and it took me to this code segment.

      Attachments

        Issue Links

          Activity

            People

              akatona Andras Katona
              akatona Andras Katona
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: