You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Martin Sillence (Jira)" <ji...@apache.org> on 2024/10/14 17:27:00 UTC

[jira] [Created] (KAFKA-17792) header parsing ends up timing out and using large quantities of memory if the string looks like a number

Martin Sillence created KAFKA-17792:
---------------------------------------

             Summary: header parsing ends up timing out and using large quantities of memory if the string looks like a number
                 Key: KAFKA-17792
                 URL: https://issues.apache.org/jira/browse/KAFKA-17792
             Project: Kafka
          Issue Type: Bug
          Components: connect
            Reporter: Martin Sillence


{color:#172b4d}We have trace headers such as:{color}

{color:#172b4d}"X-B3-SpanId": "74320e6e26adc8f8"{color}

{color:#172b4d}if however the value happens to be: "407127e212797209"{color}

{color:#172b4d}This is then treated as a numeric value and it tries to convert this as a numeric representation and an exact value using BigDecimal{color}

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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)