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

header parsing ends up timing out and using large quantities of memory if the string looks like a number

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • connect
    • None

    Description

      We have trace headers such as:

      "X-B3-SpanId": "74320e6e26adc8f8"

      if however the value happens to be: "407127e212797209"

      This is then treated as a numeric value and it tries to convert this as a numeric representation and an exact value using BigDecimal

      we end up with the trace:

          BigDecimal.setScale(int, RoundingMode) line: 2876    
          Values$ValueParser.parseAsExactDecimal(BigDecimal) line: 1044    
          Values$ValueParser.parseAsNumber(String) line: 1025    
          Values$ValueParser.parseNextToken(boolean, String) line: 892    
          Values$ValueParser.parse(boolean) line: 875    
          Values.parseString(String) line: 415    
          SimpleHeaderConverter.toConnectHeader(String, String, byte[]) line: 68    
          WorkerSinkTask.convertHeadersFor(ConsumerRecord<byte[],byte[]>) line: 578    

      this takes a long time to convert to an exact representation of a 212 billion digit integer

      Attachments

        Activity

          People

            Unassigned Unassigned
            msillence Martin Sillence
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: