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
1792 - task polling logic and state reset. #2396
1792 - task polling logic and state reset. #2396
Conversation
5c45b73
to
cc9514f
Compare
A bit of an efficiency gain? (somewhat surprisingly):
|
Indeed yes but I can confirm it is repeatable:
I'd be interested in finding out what causes the discrepancy between the memory usage on these two platforms. |
Probably(?) differences in the Python interpreter itself and/or std lib modules loaded? |
Branch in conflicts. (Sorry.) |
* Allow reset to 'submitted' or 'running'. * Allow polling of succeeded or failed tasks (but not succeeded by default). * Poll to confirm, if a message implies a state reversal. * Remove 'enable resurrection' - all tasks can return from failed. * Document how to handle preemption in light of these changes.
cc9514f
to
54d628d
Compare
Deconflicted. |
Extra memory usage likely to be caused by the new attribute in each task state object? |
No, it uses less memory according to the results above. Oliver was referring to platform differences, with the same branch. (or have I misunderstood you?) |
Looks like my deconfliction was not entirely successful... |
OK. |
Fixed. |
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.
A few comments on style. Change is otherwise OK.
lib/cylc/task_outputs.py
Outdated
def set_incomplete(self, message): | ||
"""Set output message to incomplete.""" | ||
if message in self._by_message: | ||
self._by_message[message][_IS_COMPLETED] = False |
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 just use self.set_completed(message, is_completed=False)
?
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.
OK I'll refactor these completion methods slightly...
lib/cylc/task_events_mgr.py
Outdated
if (itask.state.is_greater_than(TASK_STATUS_RUNNING) and not | ||
itask.state.confirming_with_poll): | ||
itask.state.confirming_with_poll = True | ||
poll_func(self.suite, [itask], msg=poll_msg) |
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.
Do we need a return
here as well?
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.
good spot
lib/cylc/task_events_mgr.py
Outdated
itask.state.confirming_with_poll): | ||
itask.state.confirming_with_poll = True | ||
poll_func(self.suite, [itask], msg=poll_msg) | ||
return |
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 a block here that is repeated multiple times with only 1 difference. I wonder if it is worth moving this little bit of logic into a separate private method or not.
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.
Yes, agreed (I recall considering that at the time, but forgot to come back to it...)
Feedback addressed, let see if the tests all pass... |
Something has gone wrong with these:
|
All tests good now. |
lib/cylc/cfgspec/suite.py
Outdated
@@ -548,6 +547,7 @@ def upg(cfg, descr): | |||
u.obsolete('7.2.2', ['cylc', 'simulation mode']) | |||
u.obsolete('7.2.2', ['runtime', '__MANY__', 'dummy mode']) | |||
u.obsolete('7.2.2', ['runtime', '__MANY__', 'simulation mode']) | |||
u.obsolete('7.5.0', ['runtime', '__MANY__', 'enable resurrection']) |
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.
Do we need to update this to 7.6.0
?
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.
Yes, hang on a minute...
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.
Done.
Close #1792.
Not ready for review yet. TODOtidy up code - callback args complicated by is_second_poll flagtest: e.g. manually reset a long-running task to succeeded, then poll to return it to runningdon't automatically poll succeeded tasks