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

ASF subversion and git services commented on KUDU-3790:
-------------------------------------------------------

Commit 3a4068a26bd919021345b4adf2e89ab7d6da531b in kudu's branch 
refs/heads/master from zchovan
[ https://gitbox.apache.org/repos/asf?p=kudu.git;h=3a4068a26 ]

KUDU-3790: Fix NPE in HdrHistogramAccumulator.isZero()

Spark's executor-heartbeater thread periodically calls isZero() on every
running task's accumulators. The executor-side copy of KuduContext's
"kudu.write_duration" accumulator can have its internal histogram field
observed as null before the task records its first write (unsafe
publication across threads, or constructor-bypassing deserialization such
as Kryo). isZero() then threw a NullPointerException on the heartbeater
thread, which Spark treats as fatal, killing the executor.

In this change, isZero() (and toString()) was made null-tolerant: a
null/absent histogram is logically zero.
isZero() is also now lock-free so it cannot depend on any field being
published.
Additionally HistogramWrapper now synchronizes its mutators on `this`
rather than on the reassignable `innerHistogram` var, which previously
changed the monitor object over time and provided no real mutual exclusion.

Adds HdrHistogramAccumulatorTest covering the zero semantics, a
serialization round-trip, and regression tests that force a null field
and assert isZero() does not throw.

Change-Id: Ia3d556aaf1051464303f35281d1d698b20d5ef20
Reviewed-on: http://gerrit.cloudera.org:8080/24527
Reviewed-by: Marton Greber <[email protected]>
Tested-by: Marton Greber <[email protected]>
Reviewed-by: Zoltan Martonka <[email protected]>


> HdrHistogramAccumulator.isZero() NPE on Spark's heartbeater thread
> ------------------------------------------------------------------
>
>                 Key: KUDU-3790
>                 URL: https://issues.apache.org/jira/browse/KUDU-3790
>             Project: Kudu
>          Issue Type: Bug
>            Reporter: Chovan Zoltan
>            Assignee: Chovan Zoltan
>            Priority: Major
>
> Issue:
> HdrHistogramAccumulator.isZero() can NPE on Spark's heartbeater thread, 
> killing the executor.
> Impact:
> Crashes executors in production. No KuduWriteOptions/config disables this 
> accumulator, 
> so a code fix is required.
>  



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

Reply via email to