Skip to content

large delay when using start_periodic_saving #439

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

Closed
jbweston opened this issue Jul 17, 2023 · 0 comments · Fixed by #440
Closed

large delay when using start_periodic_saving #439

jbweston opened this issue Jul 17, 2023 · 0 comments · Fixed by #440

Comments

@jbweston
Copy link
Contributor

The current implementation of 'start_periodic_saving' does await sleep(interval):

https://github.com/python-adaptive/adaptive/blob/88f02588cf66d0276b9b77da466aa71c7c1f1773/adaptive/runner.py#L839C1-L843C50

This means that there can be a large interval-length delay between the time the runner completes and the time that the last write is made by start_periodic_saving.

This is very confusing when you wait for the runner to finish with await runner.task and the results are not yet written.

Fix is to have the await await both the timeout and runner.task (remembering to shield runner.task)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant