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

FutureRecordMetadata.get deadline calculation from timeout is not using timeunit

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.0, 2.1.1
    • Component/s: clients
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: