-
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
Apply prerequisite changes to spawned tasks, on reload & restart #5334
Conversation
a45e438
to
5a8f332
Compare
(Rebased to pick up #5333) |
5a8f332
to
c154521
Compare
c154521
to
98c230d
Compare
This fix looks good to me, I've added an integration test for this (restarts are possible, they just require a little fiddling): I haven't looked into removing prereqs or reloads which I think we should also be testing? Or are there other tests for this? |
Thanks for the integration test @oliver-sanders |
This works already, for restart. Checking for tests ... nope. I've added a tweaked copy of your new integration test to cover this. |
I expect the equivalent reload will be fine. Already-spawned task proxies do have prerequisites copied on reload, and it was just the DB check on restart that caused the problem... NOPE, prerequisites are not copied over intelligently 😬 |
(Reload fixed, still working on the integration test for that ...) |
637cee2
to
4273862
Compare
After considerable pfaffing about, this should be good to go now. |
@dwsutherland - could you review at this end? It touches the datastore a bit. |
I tried testing with this example:
Then added this dependency:
And reloaded. Cylc didn't crash, but the workflow became stuck (no stall event detected): Note Rather than defaulting to |
The issue I mentioned above isn't great, but that said, it is a lot better than crashing. If it's difficult we could bump the DB stuff to a later PR as the pressure on release is quite high due to the GUI bug. |
* Accompanies cylc#5334 which fixes traceback for missing prereqs on reload/restart by marking them as unsatisfied.
Gotta fix here: hjoliver#31 However, we still need to work out how to square this with the data store which still defaults to |
(Thanks, just back to this now, I'll take a look at the problem you found, and your fix ...) |
OK what's going on is, |
Agreed with your fix @oliver-sanders ; merged it to this branch.
Yeah, minor. I think "satisfied naturally" is the only one used at the moment in Cylc 8 anyhow. Although that will change with https://cylc.github.io/cylc-admin/proposal-cylc-set.html |
From the side-PR:
Presumably I just need to call
(See above) This isn't used for anything at the moment. For now I'll just make something up to distinguish the two options. TODO
|
We had someone hit this. Strangely when they reverted the diff and ran Not sure why that happened, doesn't sound right. The good news is it was recoverable with a bit of triggering. This did remind me of the importance of these two issues: Both of which hit us whilst trying to recover the workflow. |
Gotta solution to the last three bullet points here - hjoliver#32
One conflict to shift, then I think this is good to go. |
Great, thanks. |
* Accompanies cylc#5334 which fixes traceback for missing prereqs on reload/restart by marking them as unsatisfied.
c671bcd
to
098dee6
Compare
@oliver-sanders - applied your tweaks and rebased.
|
@@ -68,6 +68,15 @@ Rose options (`-O`, `-S` & `-D`) with `cylc view`. | |||
[#5363](https://github.com/cylc/cylc-flow/pull/5363) Improvements and bugfixes | |||
for `cylc lint`. | |||
|
|||
------------------------------------------------------------------------------- | |||
## __cylc-8.1.2 (<span actions:bind='release-date'>Upcoming</span>)__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 8.1.3.
'graph_1, graph_2, ' | ||
'expected_1, expected_2, expected_3, expected_4', | ||
[ | ||
param( # Restart after adding a prerequisite to task z |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO these should have an id=
kwarg -
Imagine trying to run
pytest 'tests/i/test_task_pool.py::test_restart_prereqs[a => z\n b => z-a => z\n b => z\n c => z-expected_10-expected_20-expected_30-expected_40]'
b => z | ||
c => z''', | ||
[ | ||
('1', 'a', 'running'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that everything is at CP = 1, could we just test output[1:] = expect
and not include the '1'?
It's marginal, but I think it cuts down on the amount written. Don't care that much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving - It looks good - I've made a couple of stylistic points, but
- Reproduced the bug, failed to reproduce it on branch.
- Read Code
…_too_soon * upstream/master: (70 commits) Tweak scan CLI help. (cylc#5405) Add support for python 3.11 (cylc#5497) tests/u: add parameter ids build(deps): bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 prerequisite: remove unused interface Fix change log dup section. Fix flaky test Update CONTRIBUTING.md Tidy platforms modify CONTRIBUTING.md Bump dev version (cylc#5501) Prepare release 8.1.3 Ignore off-sequence parents, for datastore. (cylc#5495) Avoid duplicate prerequisites from multiple recurrences. (cylc#5466) Update cylc/flow/prerequisite.py prerequsite: remove target_point_strings attribute tests/f: fix events/11 swarm: convert cylc-dev Docker image to run on ubuntu:latest fix changelog Apply prerequisite changes to spawned tasks, on reload & restart (cylc#5334) ...
…too_soon * upstream/8.1.x: (46 commits) Bump dev version (cylc#5518) Prepare release 8.1.4 cat-log: fix issues with file listing Update changelog Fix `eval_host()` localhost bug & plug testing gap Bump dev version (cylc#5501) Prepare release 8.1.3 Ignore off-sequence parents, for datastore. (cylc#5495) Avoid duplicate prerequisites from multiple recurrences. (cylc#5466) tests/f: fix events/11 swarm: convert cylc-dev Docker image to run on ubuntu:latest fix changelog Apply prerequisite changes to spawned tasks, on reload & restart (cylc#5334) cat-log: don't list directories which don't exist (cylc#5488) task_job_mgr: move compute out of open call manylinux tests: update to ubuntu-20.04 Update changelog Address review Fix.platform is regex remote tidy fail (cylc#5445) parsec: better error messages for section/setting mixups ...
On restart we assume that all prerequisites of a spawned task are recorded in the DB. This will not be the case on restarting after adding new dependencies to that task.
Example:
To reproduce the bug:
cylc stop --now
whena
is still running andz
has been spawned byb:succeeded
# c => z
to add a new prerequisite (c
) task forz
The fix: if a prerequisite does not exist in the DB, assume that it is unsatisfied.
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
andconda-environment.yml
.CHANGES.md
entry included if this is a change that can affect users?.?.x
branch.