Skip to content

Fix NPE in ServerGrpcChannelBackoffResetHandler#18139

Merged
Jackie-Jiang merged 5 commits intoapache:masterfrom
timothy-e:timothye-null-check-in-backoffresethandler
Apr 15, 2026
Merged

Fix NPE in ServerGrpcChannelBackoffResetHandler#18139
Jackie-Jiang merged 5 commits intoapache:masterfrom
timothy-e:timothye-null-check-in-backoffresethandler

Conversation

@timothy-e
Copy link
Copy Markdown
Contributor

@timothy-e timothy-e commented Apr 8, 2026

Pinot integration tests failed flakily with

java.lang.NullPointerException
	at org.apache.pinot.server.starter.helix.ServerGrpcChannelBackoffResetHandler.onInstanceConfigChange(ServerGrpcChannelBackoffResetHandler.java:90)
	at org.apache.helix.manager.zk.CallbackHandler.invoke(CallbackHandler.java:362)
	at org.apache.helix.manager.zk.CallbackHandler.reset(CallbackHandler.java:772)
	at org.apache.helix.manager.zk.ZKHelixManager.resetHandlers(ZKHelixManager.java:1195)
	at org.apache.helix.manager.zk.ZKHelixManager$1.run(ZKHelixManager.java:931)

getPathChanged can return null when the notification type is FINALIZE. This was originally present in the PR that introduced this file, but removed because it was accidentally viewed as redundant.

Also, add a defensive null check before using the pathChanged, since it isn't guaranteed that pathChanged will be non-null.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.33%. Comparing base (52554ab) to head (e476593).
⚠️ Report is 33 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18139      +/-   ##
============================================
- Coverage     64.01%   63.33%   -0.68%     
- Complexity     1617     1627      +10     
============================================
  Files          3192     3229      +37     
  Lines        193936   196706    +2770     
  Branches      29937    30409     +472     
============================================
+ Hits         124140   124584     +444     
- Misses        59990    62154    +2164     
- Partials       9806     9968     +162     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-11 63.28% <100.00%> (-0.68%) ⬇️
java-21 63.30% <100.00%> (-0.69%) ⬇️
temurin 63.33% <100.00%> (-0.68%) ⬇️
unittests 63.33% <100.00%> (-0.68%) ⬇️
unittests1 55.30% <ø> (-0.58%) ⬇️
unittests2 34.98% <100.00%> (+0.59%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

// Both require a full scan to rebuild _shuttingDownServers from the current cluster state.
NotificationContext.Type type = context.getType();
if (type == NotificationContext.Type.INIT || context.getIsChildChange()) {
String pathChanged = context.getPathChanged();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should dig deeper. Do you see a code path in Helix that can result in null pathChanges?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the bug and when it was introduced. Updated PR description and the change.

@timothy-e timothy-e marked this pull request as ready for review April 10, 2026 20:53
Copy link
Copy Markdown
Contributor

@Jackie-Jiang Jackie-Jiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch on the root cause

@timothy-e timothy-e force-pushed the timothye-null-check-in-backoffresethandler branch from d81d376 to e476593 Compare April 14, 2026 13:32
@Jackie-Jiang Jackie-Jiang merged commit 9ff14da into apache:master Apr 15, 2026
46 of 48 checks passed
@Jackie-Jiang Jackie-Jiang added the bug Something is not working as expected label Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is not working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants