Skip to content

Vine: Improve Worker Kill Behavior - #4598

Open
dthain wants to merge 4 commits into
cooperative-computing-lab:masterfrom
dthain:vine-worker-faster-kill
Open

dthain wants to merge 4 commits into
cooperative-computing-lab:masterfrom
dthain:vine-worker-faster-kill

Conversation

@dthain

@dthain dthain commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

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_process would occupy a minimum of 3s at the worker. Yikes.

(At least the kill message 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_t that 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 a vine_process in the proper state. A Unix kill only 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 test Run local tests prior to pushing.
  • make format Format source code to comply with lint policies. Note that some lint errors can only be resolved manually (e.g., Python)
  • make lint Run lint on source code prior to pushing.
  • Manual Update: Update the manual to reflect user-visible changes.
  • Type Labels: Select a github label for the type: bugfix, enhancement, etc.
  • Product Labels: Select a github label for the product: TaskVine, Makeflow, etc.
  • PR RTM: Mark your PR as ready to merge.

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

dthain commented Dec 5, 2026

Copy link
Copy Markdown
Member Author

Ah, hold on, I may have gotten carried away with this one...

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