Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Add strymon terminate sub-command #15

Merged
merged 2 commits into from Nov 29, 2017

Conversation

gandro
Copy link
Member

@gandro gandro commented Nov 24, 2017

This PR adds a subcommand strymon terminate <JOB_ID> to send a termination signal to all processes belonging to a job. This PR has not yet been extensively tested, but I wanted get some feedback first since I won't work on this before next week.

The change turned out to be a bit more complex than I expected, mostly because an executor needs to perform some book-keeping to be able to serve external termination requests, but it need to clean up this state if the process terminates by itself. The termination request is sent to all participating executors of a job.

On Unix, this the termination signal results in a SIGTERM signal being sent to the child process. On Windows, this functionality is currently not implemented, but likely be done via TerminateProcess.

There is currently no restriction on who is allowed to terminate a running job.

Fixes #12

This extends executors with the capability to send a termination
signal to their children on request. Termination requests are
sent to the coordinator and forwared to all executors participating
in a job.

On Unix, this results in a SIGTERM signal being sent to the child
process. On Windows, this functionality is currently not implemented,
but likely be done via `TerminateProcess`.

There is currently no restriction on who is allowed to terminate
a running job.

Closes strymon-system#12

Signed-off-by: Sebastian Wicki <swicki@inf.ethz.ch>
@@ -43,6 +43,14 @@ impl Dispatch {

self.handle.spawn(submission);
}
"Termination" => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use the associated str from rpc here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good catch!

Signed-off-by: Moritz Hoffmann <moritz.hoffmann@inf.ethz.ch>
@antiguru antiguru merged commit 7742106 into strymon-system:master Nov 29, 2017
@gandro gandro deleted the terminate-job branch November 30, 2017 16:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants