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

Fix execution time limit polling intervals [cylc 8] #5753

Merged
merged 5 commits into from
Oct 5, 2023

Conversation

wxtim
Copy link
Member

@wxtim wxtim commented Oct 4, 2023

Response to a bug not otherwise recorded:

Bug description

If the sum of execution polling intervals < execution time limit the remainder should be added to the first, but only the first execution time limit polling interval. Currently the remainder is always added to the first items in the list of execution time limit polling intervals.

The last item in the list of execution time limit polling intervals is repeated until the final itask timeout. At the moment if we set only one item in execution time limit polling intervals then every polling interval is execution time limit polling intervals[0] + remainder.

Example

execution_time_limit = 60
execution_polling_intervals = [50]
execution time limit polling intervals = [10]

list_of_polling_intervals_is = [50, 20] # polls onwards at intervals of 20s ...
list_of_polling_intervals_should_be = [50, 20, 10]   # polls onwards at intervals of 10s ...

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg (and conda-environment.yml if present).
  • Tests are included (or explain why tests are not needed).
  • CHANGES.md entry included if this is a change that can affect users
  • Cylc-Doc pull request opened if required at cylc/cylc-doc/pull/XXXX.
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@wxtim wxtim marked this pull request as draft October 4, 2023 07:52
@wxtim wxtim force-pushed the fix.execution_retry_delays branch from b5d3f11 to d78a682 Compare October 4, 2023 08:00
if delays:
size = int((time_limit - sum(delays)) / delays[-1])
delays.extend([delays[-1]] * size)
time_limit_delays[0] += time_limit - sum(delays)
Copy link
Member Author

Choose a reason for hiding this comment

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

The last member of the list is repeated.

if len(time_limit_delays) == 1 then all subsequent delays are not the set execution time limit polling intervals, but that value + the remainder of the execution polling intervals under the time limit.

Comment on lines 1665 to 1669
if len(time_limit_polling_intervals) > 1:
time_limit_polling_intervals[0] += time_limit - sum(delays)
else:
delays.append(
time_limit_polling_intervals[0] + time_limit - sum(delays))
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the bug fix - the rest is refactoring for easier testing.

- time_limit_polling_intervals[0] += time_limit - sum(delays)

@wxtim wxtim self-assigned this Oct 4, 2023
@wxtim wxtim added the bug Something is wrong :( label Oct 4, 2023
@wxtim wxtim added this to the cylc-8.2.2 milestone Oct 4, 2023
@wxtim wxtim changed the base branch from master to 8.2.x October 4, 2023 09:32
@wxtim wxtim force-pushed the fix.execution_retry_delays branch from 322d2aa to e7f932d Compare October 4, 2023 09:35
@wxtim wxtim force-pushed the fix.execution_retry_delays branch from e7f932d to 7bee764 Compare October 4, 2023 09:36
@wxtim wxtim marked this pull request as ready for review October 4, 2023 09:54
@wxtim wxtim changed the title Fix execution time limit polling intervals Fix execution time limit polling intervals [cylc 8] Oct 4, 2023
@oliver-sanders oliver-sanders modified the milestones: cylc-8.2.2, cylc-8.2.3 Oct 4, 2023
changes.d/5753.fix.md Outdated Show resolved Hide resolved
cylc/flow/task_events_mgr.py Outdated Show resolved Hide resolved
wxtim and others added 2 commits October 5, 2023 09:43
Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com>
Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com>
@wxtim wxtim requested a review from MetRonnie October 5, 2023 08:44
@MetRonnie
Copy link
Member

Kicking tests

@MetRonnie MetRonnie closed this Oct 5, 2023
@MetRonnie MetRonnie reopened this Oct 5, 2023
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.

I haven't manually tested but I'm happy that the tests are comprehensive enough

cylc/flow/task_events_mgr.py Outdated Show resolved Hide resolved
cylc/flow/task_events_mgr.py Show resolved Hide resolved
Co-authored-by: Oliver Sanders <oliver.sanders@metoffice.gov.uk>
@oliver-sanders oliver-sanders merged commit d02d66c into cylc:8.2.x Oct 5, 2023
24 of 25 checks passed
@wxtim wxtim deleted the fix.execution_retry_delays branch October 9, 2023 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is wrong :(
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants