Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Several moderate issues remain, including sequential cleanup that can multiply shutdown delays, a registration-failure path that can leak launched plugins, and tests excluded from normal runs.
3 open issues
1 file not reviewed
pkg/api/api_vtproto.pb.go: Generated file
What changed in this PR
Adds graceful shutdown support for NRI-launched plugins, allowing configured stop signals and a grace period before forceful termination.
Changes:
- Adds configurable stop-signal support through the API and
WithStopSignal. - Adds a default five-second stop timeout with signal, wait, and kill lifecycle handling.
- Applies parallel plugin shutdown and documents launch, configuration, and graceful-stop behavior.
- Adds Unix-specific tests for graceful stopping, timeout kills, parallel shutdown, and configuration validation.
This pull request requires changes.
| File | Changes and review findings |
|---|---|
README.md |
Documents plugin launch, configuration, and graceful shutdown. Moderate (1 vote): failed startup cleanup can leave a connected process running. Nit (1 vote): clarify that killing applies to runtime-launched plugins, while external plugins are disconnected. |
pkg/stub/stub.go |
Adds WithStopSignal and includes the selected signal in configuration responses. Moderate (1 vote): reject uncatchable signals such as SIGKILL and SIGSTOP, and validate protocol responses consistently. |
pkg/api/timeouts.go |
Defines the default plugin stop timeout. |
pkg/api/api.proto |
Adds the stop_signal configuration field. |
pkg/api/api_vtproto.pb.go |
Adds serialization and deserialization support for stop_signal. |
pkg/adaptation/plugin.go |
Implements signal-based stopping, timeout handling, and process reaping. Moderate (3 votes): kill launched plugins when registration fails via connection closure. Moderate (1 vote): validate stop signals and reject uncatchable or invalid values. |
pkg/adaptation/plugin_stop_test.go |
Adds tests for graceful signals, timeout kills, parallel stopping, and configuration validation. Moderate (3 votes): replace the unsupported unix build tag with supported GOOS constraints so tests run normally. |
pkg/adaptation/adaptation.go |
Adds concurrent plugin shutdown and startup cleanup. Moderate (2 votes): use the parallel helper when removing closed plugins to avoid cumulative stop timeouts. |
Review effort: Lite
mikebrow
force-pushed
the
address-graceful-shutdown-todo
branch
from
October 29, 2026 00:46
341a9bc to
27baaba
Compare
mikebrow
force-pushed
the
address-graceful-shutdown-todo
branch
from
November 19, 2026 19:28
27baaba to
8830da8
Compare
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
mikebrow
force-pushed
the
address-graceful-shutdown-todo
branch
from
November 19, 2026 19:45
8830da8 to
1a545b1
Compare
Member
Author
|
had to rebase, fix conflicts, and fix a new modernize lint check.. for for range loops |
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.

This feature adds support for graceful shutdown of NRI launched plugins, removing an old TODO to send a stop signal in this case waiting for a timeout then sending the kill.
Also adds some doc explaining how plugins are typically launched and configured then later how this feature is used.
some drafting assistance from IBM Bob