Repository navigation
Plugin supervisor: its own file, plugins killed on quit, stderr capped - #16
Merged
Merged
Conversation
plugins.rs becomes plugins/mod.rs (manifests, discovery, approvals, update checks) and plugins/supervisor.rs (each plugin's process, its settings and commands). Code is moved, not changed; the two embedded-file paths follow the new folder.
… stderr lines capped A Process owns a plugin's process group, its signals and its stop deadline, and never signals a pid that has been waited for. Quitting now waits up to half a second for plugins and then kills them and what they started: before, Lumen exited first and one that ignored SIGTERM lived on. A stderr line over 16 KB is logged in pieces instead of growing in memory, and bytes that aren't UTF-8 no longer end the log.
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.
The last structural item from the 1.3.1 review: a dedicated place for running plugins. Two commits, a pure move and then the changes.
1. The move.
src/plugins.rsbecomessrc/plugins/mod.rs(manifests, discovery, approvals, update checks) andsrc/plugins/supervisor.rs(each plugin's process, its settings and commands). Line for line the same code, apart from module boilerplate and twoinclude_str!paths that follow the new folder.2. The supervisor.
Processtype owns a plugin's process: starting it in a process group of its own, signalling the group, the stop deadline, and never signalling a pid that has been waited for. That was spread over five functions and two structs.docs/plugin-protocol.mdsaid the two-second kill applied on quit too. It now says what happens.Two new tests: the quit deadline (a plugin that exits when asked, and one that ignores SIGTERM along with its child) and the stderr cap. 261 Rust tests pass locally. Not yet tried by hand: quitting a running Lumen with a plugin that ignores SIGTERM.
Not done here: messages from Lumen to a plugin queue without a bound, so a plugin that subscribes to events and never reads them grows Lumen's memory. That is in the writer
src/api.rsshares with socket clients.