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

stop: fix tracebacks #4776

Merged
merged 1 commit into from
Apr 4, 2022
Merged

stop: fix tracebacks #4776

merged 1 commit into from
Apr 4, 2022

Conversation

oliver-sanders
Copy link
Member

@oliver-sanders oliver-sanders commented Mar 25, 2022

@oliver-sanders oliver-sanders added the could be better Not exactly a bug, but not ideal. label Mar 25, 2022
@oliver-sanders oliver-sanders added this to the cylc-8.0rc3 milestone Mar 25, 2022
@oliver-sanders oliver-sanders self-assigned this Mar 25, 2022
* Closes 4758
Copy link
Member

@hjoliver hjoliver left a comment

Choose a reason for hiding this comment

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

If I try to stop two non-existent workflows on this branch:

$ cylc stop foo bar
foo
Done
bar
Done

Shouldn't we distinguish between stopped and not even installed?

In this case, the ServiceFileError is caught and raised as WorkflowStopped in network/__init__.py by the get_location function, without checking the workflow is actually "stopped", or at least installed.

@oliver-sanders
Copy link
Member Author

In this case, the ServiceFileError is caught and raised as WorkflowStopped in network/init.py by the get_location function, without checking the workflow is actually "stopped", or at least installed.

This behaviour is a bit of a pain, e.g. #4748.

Perhaps we should update this logic to raise a "workflow does not exist error" (note this will be raised by orphan jobs left running after the workflow is removed)

Copy link
Member

@MetRonnie MetRonnie left a comment

Choose a reason for hiding this comment

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

Other than Hilary's comment, manually testing ok. Perhaps a functional test would not go amiss?

@oliver-sanders oliver-sanders marked this pull request as draft March 28, 2022 13:35
@oliver-sanders
Copy link
Member Author

Drafting this whilst I ponder on the consequences of changing the exception to handle the workflow does not exist case.

@oliver-sanders
Copy link
Member Author

On a job host with communications method = poll it is not really possible to tell whether the workflow is running or not, or whether it even exists on the workflow host which makes it hard to truly differentiate these error cases.

That said, if possible it would be good to differentiate in this case, e.g. consider a workflow with "broadcast" tasks being ported to a polling job host. The error WorkflowStopped would not lead the porter to the issue.

@oliver-sanders
Copy link
Member Author

Telling stopped from non-existent workflows, whilst simple in some cases is tricky in others and somewhat off topic for this issue.

Would be nice to do, one of the possible advantages would be assisting the porting of workflows to polling job hosts where cylc commands will currently fail with a confusing WorkflowStopped message.

Unfortunately in light of the above it might not be possible without changing the way we manage polling job hosts I.E. putting back the contact2 file to allow them to tell when the parent workflow is running. This would work, but with the caveat that if the scheduler is killed or fails to remote-tidy it will continue to look like it's running from the remote's perspective (as a polling job host can't just SSH back to the scheduler host to check if it's still running, if we could do that the host would use TCP/SSH+TCP comms).

@oliver-sanders
Copy link
Member Author

Have bumped the rest to an 8.1.0 issue - #4798 - because It's not that quick a fix.

@oliver-sanders oliver-sanders requested a review from MetRonnie April 4, 2022 11:36
Copy link
Member

@MetRonnie MetRonnie left a comment

Choose a reason for hiding this comment

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

Hasn't changed since my last review, right?

Other than Hilary's comment, manually testing ok. Perhaps a functional test would not go amiss?

@hjoliver
Copy link
Member

hjoliver commented Apr 4, 2022

I'll merge this. Patch coverage is 100% anyway.

@hjoliver hjoliver merged commit 2acd5d8 into cylc:master Apr 4, 2022
@oliver-sanders oliver-sanders deleted the 4758 branch April 5, 2022 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
could be better Not exactly a bug, but not ideal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cylc stop traceback
3 participants