Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced handling of command termination when autoresume is engaged #151

Open
ddtm opened this issue Jan 12, 2017 · 0 comments
Open

Advanced handling of command termination when autoresume is engaged #151

ddtm opened this issue Jan 12, 2017 · 0 comments

Comments

@ddtm
Copy link
Contributor

ddtm commented Jan 12, 2017

Right now we are adding the running command back to pending list unconditionally. This may not be desirable in some cases, e.g. when the termination triggers checkpointing which can potentially fail and in this scenario it's better to put the command into the finished list specifying the returned error code.

A snippet to illustrate the idea:

if sigterm_handler.proc is not None:
    error_code = sigterm_handler.proc.wait()
 if sigterm_handler.command is not None:
    if error_code == 0:  # The command was terminated successfully.
        command_manager.set_running_command_as_pending(sigterm_handler.command)
    else:
        command_manager.set_running_command_as_finished(sigterm_handler.command, error_code)

Relevant code: smartdispatch/workers/base_worker.py:54

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

No branches or pull requests

1 participant