Repository navigation
Conversation
This ensures that a kill() is only sent to a valid pid that is currently running. And removes an unneeded delay when processing a kill message for a completed task.
Member
Author
|
Ah, hold on, I may have gotten carried away with this one... |
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.
Proposed Changes
The prior code had a mysterious min 3 second runtime prior to killing a task running at the worker! The explanation in the comments is that a recently-started process might potentially drop an incoming signal if not fully initialized. (Ok, maybe, but extraordinarily rate.) But even worse, this delay would be paid (and the signal sent) even when the process had already exited and didn't need to be killed! The result was that every task (and every transfer implemented as a
vine_processwould occupy a minimum of 3s at the worker. Yikes.(At least the
killmessage from the manager to the worker was asynchronous, so that manager would not be held up by the delay.)This patch introduces
vine_process_state_tthat simply keeps track of the worker's understanding of whether a process is running or not, so that the various actions (execute, kill, wait) only work on avine_processin the proper state. A Unixkillonly gets set to a process actually running. And then a delay of up to one second occurs only if the process is in the running state for less than one second.Merge Checklist
The following items must be completed before PRs can be merged.
Check these off to verify you have completed all steps.
make testRun local tests prior to pushing.make formatFormat source code to comply with lint policies. Note that some lint errors can only be resolved manually (e.g., Python)make lintRun lint on source code prior to pushing.