Skip to content

[Backport 3.5] fix: Accept nullable ResourceSharingClient to prevent NPE on feature disable(#1204)#1207

Draft
DarshitChanpura wants to merge 1 commit into
opensearch-project:3.5from
DarshitChanpura:backport-1204-to-3.5
Draft

[Backport 3.5] fix: Accept nullable ResourceSharingClient to prevent NPE on feature disable(#1204)#1207
DarshitChanpura wants to merge 1 commit into
opensearch-project:3.5from
DarshitChanpura:backport-1204-to-3.5

Conversation

@DarshitChanpura

Copy link
Copy Markdown
Member

Backports #1204 to 3.5

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…disable (opensearch-project#1204)

When the resource-sharing feature flag is disabled via cluster settings,
the security plugin calls assignResourceSharingClient(null) on all
registered ResourceSharingExtension implementations to clear the client.

The Kotlin non-null parameter declaration causes an immediate NPE in
ClusterApplierService.applyChanges(), preventing cluster state from being
published to follower nodes. The master steps down and re-election hits
the same failure, creating an infinite election loop.

Fix: Change parameter types to nullable (ResourceSharingClient?) in both
ReportsSchedulerExtension and ResourceSharingClientAccessor. The internal
field was already declared nullable and getResourceSharingClient() already
returns nullable, so all callers handle null correctly.

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
@DarshitChanpura DarshitChanpura changed the title fix: Accept nullable ResourceSharingClient to prevent NPE on feature … [Backport 3.5] fix: Accept nullable ResourceSharingClient to prevent NPE on feature disable(#1204) Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants