-
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
flow-nums data-store fix #6115
flow-nums data-store fix #6115
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
It seems to be marking a succeeded task as failed: https://github.com/cylc/cylc-flow/actions/runs/9301382754/job/25601035801?pr=6115#step:17:3293 Reporting on the task status from the wrong flow? |
I think a delta is being overwritten by another delta... maybe |
Ah, I think I know what's happening..
When you start the workflow up again, the states and prerequisites of tasks are loaded from the DB .. including However, when you trigger a task it's prerequisites aren't loaded.. So this change is correctly setting the prerequisites to the newly triggered So I can either:
Ideally maybe option 3 (?) However, we shouldn't do option 2, as I can imagine cases where the new object does have correct prerequisites (i.e. from a reflow and/or after reload ).. So I'm going to change the test.. |
d285cb9
to
4aa7f52
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I would go for the minimal change to fix the issue and kick wider Cylc implementation stuff to an issue. @MetRonnie are you happy with the amended test? |
Tried this out, seems to do the job. Wrote an integration test which fails before and passes after this change: dwsutherland#20 Discovered an unrelated bug in the process: #6174 |
(Figured out that the tests were passing locally for me because the |
cylc/flow/data_store_mgr.py
Outdated
self._process_internal_task_proxy(itask, tp_existing) | ||
statics = {'id'} | ||
for field, _ in tp_existing.ListFields(): | ||
old_value = getattr(tp_delta, field.name, None) | ||
if old_value and field.name not in statics: | ||
tp_delta.ClearField(field.name) | ||
tp_delta.MergeFrom(tp_existing) | ||
|
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.
I think it would be useful to add a comment explaining what this is for
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.
I'm not convinced this is doing anything, actually
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.
We have in the general delta application..
Some protobuf fields are additive .. i.e. if the two messages contain lists, then the list would extend on MergeFrom
, this can be a problem if we don't want duplicates in the list (i.e. we just want to replace one list with the new).. So we Clear them first.
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.
Is there a reason this couldn't simply be
-tp_existing = PbTaskProxy(id=tp_id)
-
-self._process_internal_task_proxy(itask, tp_existing)
+self._process_internal_task_proxy(itask, tp_delta)
-statics = {'id'}
-for field, _ in tp_existing.ListFields():
- old_value = getattr(tp_delta, field.name, None)
- if old_value and field.name not in statics:
- tp_delta.ClearField(field.name)
-tp_delta.MergeFrom(tp_existing)
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.
Let me see if _process_internal_task_proxy
wipes out the fields it's writing to .. If so, then yes, otherwise I already explained:
Some protobuf fields are additive .. i.e. if the two messages contain lists, then the list would extend on MergeFrom, this can be a problem if we don't want duplicates in the list (i.e. we just want to replace one list with the new).. So we Clear them first.
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.
I had added that block in the last commit.. However, it may have been a precautionary move.
I've reviewed the code, and the protobuf fields .. The one field that would have been effected is already cleared in _process_internal_task_proxy
, the other mappings and fields should be ok. So, I've removed that block.
Let's see how my review and removal goes..
Sounds like it would make sense to set
(sry, hit wrong button) |
|
(that fix is now in, rebase this PR to pick it up) |
(@dwsutherland, one unresolved review comment above) |
Replied.. hopefully this convinces you @MetRonnie |
4aa7f52
to
1ee9508
Compare
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.
👍
(Note, no changelog entry required, this does not impact users at present) |
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.
👍🏼
closes #6114
Using example from above produces:
![image](https://private-user-images.githubusercontent.com/11400777/335155017-0afacc63-3eda-4f17-ae43-15eef938d579.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NTU3ODcsIm5iZiI6MTczOTU1NTQ4NywicGF0aCI6Ii8xMTQwMDc3Ny8zMzUxNTUwMTctMGFmYWNjNjMtM2VkYS00ZjE3LWFlNDMtMTVlZWY5MzhkNTc5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDE3NTEyN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAwMzRjZThkZDk3Y2I4MWMxZTVjYzEyOWFjNTU2MDQzNThiZWNiZmUxNjBjOThmZmE0NWVmMmY0ZjA4MTRjNjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ODwwXAUrtEMIrv9EbMz0bYY7RPVxZBHjhYfLrN8FTc4)
The solution was to create a delta from the new task proxy (instead of trying to overwrite the existing).
existing tests should cover code (?)
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).?.?.x
branch.