[ 
https://issues.apache.org/jira/browse/KAFKA-8012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16781133#comment-16781133
 ] 

ASF GitHub Bot commented on KAFKA-8012:
---------------------------------------

hachikuji commented on pull request #6333: KAFKA-8012: Ensure partitionStates 
have not been removed before truncating.
URL: https://github.com/apache/kafka/pull/6333
 
 
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> NullPointerException while truncating at high watermark can crash replica 
> fetcher thread
> ----------------------------------------------------------------------------------------
>
>                 Key: KAFKA-8012
>                 URL: https://issues.apache.org/jira/browse/KAFKA-8012
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.2.0, 2.1.1
>            Reporter: Colin Hicks
>            Assignee: Colin Hicks
>            Priority: Blocker
>             Fix For: 2.2.0
>
>
> An NPE can occur when the replica fetcher manager simultaneously calls 
> `removeFetcherForPartitions`, removing the corresponding partitionStates, 
> while a replica fetcher thread attempts to truncate the same partition(s) in 
> `truncateToHighWatermark`.
> Stack trace for failure case:
> {{java.lang.NullPointerException}}
> {{at 
> kafka.server.AbstractFetcherThread.$anonfun$truncateToHighWatermark$2(AbstractFetcherThread.scala:213)}}
> {{at scala.collection.mutable.HashSet.foreach(HashSet.scala:79)}}
> {{at 
> kafka.server.AbstractFetcherThread.$anonfun$truncateToHighWatermark$1(AbstractFetcherThread.scala:211)}}
> {{at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)}}
> {{at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:251)}}
> {{at 
> kafka.server.AbstractFetcherThread.truncateToHighWatermark(AbstractFetcherThread.scala:207)}}
> {{at 
> kafka.server.AbstractFetcherThread.maybeTruncate(AbstractFetcherThread.scala:173)}}
> {{at 
> kafka.server.AbstractFetcherThread.doWork(AbstractFetcherThread.scala:112)}}
> {{at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:82)}}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to