Repository navigation
fix: server robustness for dmesg grep, handler panics, exec cancellation and MPA expiry - #646
Open
sfc-gh-pkowalewski wants to merge 5 commits into
Open
sfc-gh-pkowalewski wants to merge 5 commits into
sfc-gh-pkowalewski wants to merge 5 commits into
Conversation
Compile the grep expression before reading kernel messages and return InvalidArgument when it doesn't parse, matching LocalFile.Read.
Install unary and stream interceptors at the front of the chain that turn a panic into an Internal error and log it, so one bad request fails on its own instead of taking the server down.
Exec now starts commands in their own process group and, when the request context is done, kills the whole group. Previously only the direct child was killed, so anything it had started kept running and could hold the output pipes open well past the deadline.
Approve used to reset the action's timestamp, so repeated approvals kept an action from ever reaching maxMPAApprovedAge. Track the creation time instead and use it for both expiry and eviction.
…cancellation RunCommand now kills the group on cancellation even after the direct child has exited, so processes it left in the background can't keep Run waiting on their output. Killing a group that no longer exists reports os.ErrProcessDone.
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.
A few robustness fixes in the server:
SysInfo.Dmesgcompiles the grep pattern up front and returnsInvalidArgumentfor one that doesn't parse, the same wayLocalFile.Readalready does.Internalfor that request instead of exiting.Execruns commands in their own process group and kills the whole group when the request is cancelled, so background processes don't outlive the call or hold its output pipes open.