[ 
https://issues.apache.org/jira/browse/KAFKA-17725?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ming-Yen Chung resolved KAFKA-17725.
------------------------------------
    Fix Version/s: 4.2.0
       Resolution: Fixed

> RecordHeader key() is not thread safe
> -------------------------------------
>
>                 Key: KAFKA-17725
>                 URL: https://issues.apache.org/jira/browse/KAFKA-17725
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients
>            Reporter: Xiaobing Fang
>            Priority: Major
>             Fix For: 4.2.0
>
>
> {code:java}
> public String key() {
>     if (key == null) {
>         key = Utils.utf8(keyBuffer, keyBuffer.remaining());
>         keyBuffer = null;
>     }
>     return key;
> } {code}
> This method in RecordHeader is not thread safe.
> It may throw NPE when it is accessed concurrently by multiple threads, 
> because keyBuffer maybe null by pre thread.



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

Reply via email to