Skip to content

Expose workload management action notifications - #1

Draft
RyanL1997 wants to merge 1 commit into
mainfrom
audit/wlm-action-events
Draft

RyanL1997 wants to merge 1 commit into
mainfrom
audit/wlm-action-events

Conversation

@RyanL1997

Copy link
Copy Markdown
Owner

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

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

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>
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.

1 participant