Repository navigation
Conversation
Add an experimental node-local notifier that fires when a workload group rejects a search at admission or cancels a running search's task, and make it available to plugins through the plugin component registry. Listeners run synchronously on the rejecting or cancelling thread and must not block. A listener throwing a runtime exception is logged and does not replace the original rejection. With no listeners registered, no event is allocated. Rejections carry no task id, because no task exists yet at admission. Cancellations carry no resource attribution, because the resource that caused the group to be selected for cancellation is not available at the per-task callback. Signed-off-by: Jialiang Liang <jiallian@amazon.com>
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add an experimental node-local action notifier for workload management and make it available to plugins through the plugin component registry. A workload group rejecting a search at admission, or cancelling a running search's task, each emit once at the point of the action with the workload group id, resiliency mode, the breaching resource type, its threshold, the observed usage and the task id.
Listeners execute synchronously and must be non-blocking. Runtime exceptions from listeners are logged without replacing the original
OpenSearchRejectedExecutionException, and without listeners the notifier avoids allocating an event. Cancellations are raised from the workload management monitoring thread rather than the request's own, so listeners must not rely on request context being available. Rejections carry no task id (-1) because no task exists yet at admission; cancellations carry no resource attribution, since the resource that caused the group to be picked for cancellation is not available at the per-task callback.This follows the shape of cwperks#418 for circuit breaker trips. Together they cover the two ways a search can be stopped by resource governance rather than by its own content. The motivation is the same: an audit record today shows that a request arrived, and nothing about what workload management then did to it. The companion Security change consumes this notifier.
Validation:
JAVA_HOME=/usr/lib/jvm/java-21-amazon-corretto ./gradlew :server:test --tests 'org.opensearch.wlm.WorkloadGroupServiceTests' --console=plain— passed, 69 tests.JAVA_HOME=/usr/lib/jvm/java-21-amazon-corretto ./gradlew :server:spotlessJavaCheck precommit --console=plain— passed.Related Issues
None.
Check List
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.