Skip to content

Handle finalize and null-path instance config callbacks#18173

Open
xiangfu0 wants to merge 2 commits intoapache:masterfrom
xiangfu0:server-grpc-backoff-reset-handler-fix
Open

Handle finalize and null-path instance config callbacks#18173
xiangfu0 wants to merge 2 commits intoapache:masterfrom
xiangfu0:server-grpc-backoff-reset-handler-fix

Conversation

@xiangfu0
Copy link
Copy Markdown
Contributor

@xiangfu0 xiangfu0 commented Apr 12, 2026

Summary

  • handle NotificationContext.Type.FINALIZE in ServerGrpcChannelBackoffResetHandler
  • fall back to a full scan when Helix does not provide pathChanged
  • keep _shuttingDownServers lifecycle-safe instead of assuming every non-init callback is a single-instance update

Why

ServerGrpcChannelBackoffResetHandler currently assumes every non-INIT / non-child-change callback has a populated pathChanged, and it does not clear local state on FINALIZE. That is brittle against Helix callback lifecycle edges.

Validation

  • ./mvnw -pl pinot-server -am -Dtest=ServerGrpcChannelBackoffResetHandlerTest test -Dsurefire.failIfNoSpecifiedTests=false

@xiangfu0 xiangfu0 force-pushed the server-grpc-backoff-reset-handler-fix branch from 439d805 to d31db22 Compare April 12, 2026 06:47
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 12, 2026

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 63.29%. Comparing base (5cde60a) to head (8cabf74).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...er/helix/ServerGrpcChannelBackoffResetHandler.java 90.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18173      +/-   ##
============================================
- Coverage     63.30%   63.29%   -0.01%     
+ Complexity     1627     1624       -3     
============================================
  Files          3224     3224              
  Lines        196558   196565       +7     
  Branches      30365    30367       +2     
============================================
- Hits         124426   124421       -5     
- Misses        62177    62178       +1     
- Partials       9955     9966      +11     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-11 63.28% <90.00%> (+<0.01%) ⬆️
java-21 34.94% <90.00%> (-28.34%) ⬇️
temurin 63.29% <90.00%> (-0.01%) ⬇️
unittests 63.29% <90.00%> (-0.01%) ⬇️
unittests1 55.25% <ø> (-0.05%) ⬇️
unittests2 34.97% <90.00%> (+0.02%) ⬆️

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.

@xiangfu0 xiangfu0 requested a review from Copilot April 12, 2026 12:04
@xiangfu0 xiangfu0 added the flaky-test Tracks a test that intermittently fails label Apr 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves ServerGrpcChannelBackoffResetHandler resiliency to Helix callback lifecycle edge cases by explicitly handling FINALIZE events and tolerating callbacks where pathChanged is missing.

Changes:

  • Clear tracked shutdown state on NotificationContext.Type.FINALIZE to avoid stale lifecycle state.
  • Fall back to a full cluster scan when Helix does not provide context.getPathChanged().
  • Add unit tests covering FINALIZE handling and null-pathChanged fallback behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pinot-server/src/main/java/org/apache/pinot/server/starter/helix/ServerGrpcChannelBackoffResetHandler.java Handles FINALIZE by clearing local state; safely falls back to full scan when pathChanged is absent.
pinot-server/src/test/java/org/apache/pinot/server/starter/helix/ServerGrpcChannelBackoffResetHandlerTest.java Adds tests validating FINALIZE clears tracked state and that null pathChanged triggers a full scan/reset.

@xiangfu0 xiangfu0 force-pushed the server-grpc-backoff-reset-handler-fix branch from d31db22 to 8cabf74 Compare April 13, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flaky-test Tracks a test that intermittently fails

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants