-
Notifications
You must be signed in to change notification settings - Fork 94
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
sys.exit traceback running 8.3+ on MacOS #6291
Comments
The offending commit is apparently this one: $ git bisect bad
8140c6f6a2fa4c7ac44ded0f60bdcdf3bd145bb2 is the first bad commit
commit 8140c6f6a2fa4c7ac44ded0f60bdcdf3bd145bb2 (HEAD)
Author: Mark Dawson <[email protected]>
Date: Wed Nov 1 17:00:39 2023 +0000
made reinstall work on multiple workflows
flake8 clean up
fixed unit tests
fixed cylc-combination/01-vr-reload functional test
fixed cylc-reinstall/00-simple.t functional test
updated change log
review amends
changes.d/5803.feat.md | 1 +
cylc/flow/scheduler_cli.py | 46 ++++++++++++++++++++++++++++------------------
cylc/flow/scripts/reinstall.py | 35 +++++++++++++++++++++--------------
cylc/flow/scripts/validate_reinstall.py | 25 +++++++++++++++----------
tests/functional/cylc-reinstall/00-simple.t | 1 +
tests/integration/test_reinstall.py | 49 +++++++++++++++++++++++++------------------------
6 files changed, 91 insertions(+), 66 deletions(-)
create mode 100644 changes.d/5803.feat.md From PR #5803 |
It's something to do with the asyncio changes in |
Aah. The asyncio stuff in If the process is being daemonized, then control is passed over to the new fork. However, asyncio is not yet initalised in that fork so we have to open a new loop. This has resulted in the highly illogical situation where cylc-flow/cylc/flow/scheduler_cli.py Lines 425 to 433 in b46f35a
Calling The solution must work for:
|
Traceback aside, is this symptomless? If so, is this just Python reporting the If that's the case, I wonder if doing something along these lines would help: # cylc/flow/scheduler_cli
@cli_function(get_option_parser)
def play(parser: COP, options: 'Values', id_: str):
try:
return asyncio.run(scheduler_cli(options, id_))
except SystemExit as exc:
sys.exit(exc.code) Totally illogical of course! |
Yes, that's right. But I couldn't avoid the traceback using any variant of your suggestion that I tried. Another way seems to work, see upcoming PR. |
* Closes cylc#6291 * The `cylc play` command would sometimes produce traceback when detaching workflows (the default unless `--no-detach` is used). * This traceback does not appear to have had any ill effects, but may have suppressed the normal Python session teardown logic. * It was only reported on Mac OS, but may potentially occur on other systems. * This PR mitigates the circumstances under which the traceback occurred by separating the asyncio event loops that are run before and after daemonization.
Traceback appears in terminal on start-up in detaching mode, since 8.3.0 (8.2.7 was fine)
The workflow still runs, but a similar traceback appears in the scheduler log on shutdown
The text was updated successfully, but these errors were encountered: