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

Pipeline run status stuck on running with qcluster timeout or ctrl-c #594

Open
ajstewart opened this issue Dec 22, 2021 · 0 comments
Open
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed low priority Issue is not of immediate concern.

Comments

@ajstewart
Copy link
Contributor

ajstewart commented Dec 22, 2021

If a run is killed or hits the qcluster timeout then the status of the run is left as 'running'. This really should be switched to 'error'.

It's possible to catch such events using signal handling, for example:

def termination_signal_handler(sig, frame, pipeline, p_run) -> None:
    # Set pipeline run to error and shutdown
    # logger is globally set.
    logger.warning('Pipeline terminated, shutting down...')
    pipeline.set_status(p_run, 'ERR')
    logger.debug("Pipeline set to 'Error' status.")

    # now terminate logger process
    logging.shutdown()

    sys.exit()    

def run_pipe(...):
    ...
    # register the terminate handler
    sigterm_handler = partial(
        termination_signal_handler,
        pipeline=pipeline,
        p_run=p_run
    )
    signal.signal(signal.SIGTERM, sigterm_handler)
    signal.signal(signal.SIGINT, sigterm_handler)

However when I tried this approach if it is called on a part when the Dask multiprocessing is taking place it really didn't like it and still crashes out. I could not find a way to either gracefully wait for the children to finish or kill them early. If outside of dask then it works ok, so it might be along the right track.

How feasible it is to do this I'm not sure but it's also possible to just accept this behaviour and require admins to sort the run out.

Side note: Django-q is also a bit of a pain because as it stands right now, a run will always be retried at least once if it times out. So you could argue that leaving it as running is beneficial in this case as it will just exit on the second run attempt.

@ajstewart ajstewart added bug Something isn't working enhancement New feature or request low priority Issue is not of immediate concern. labels Dec 22, 2021
@github-actions github-actions bot added this to To do in Pipeline Backlog Dec 22, 2021
@github-actions github-actions bot added this to To do in Nimbus Production Dec 22, 2021
@ajstewart ajstewart added the help wanted Extra attention is needed label Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed low priority Issue is not of immediate concern.
Projects
Development

No branches or pull requests

1 participant