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

Use get_run_status() instead of get_run() to check status #100

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

jkotilahti
Copy link
Member

@jkotilahti jkotilahti commented Nov 7, 2023

Previously, wait_for_results() and wait_for_compilation() used get_run() to check the status of the job. The RunResult returned by get_jobs() contains metadata which contains the original job request, so if the original job request was large, it could take a long time to send and decode the RunResult JSON even before job results are ready. This meant that, for example, wait_for_results() might end up checking the status only every 30 seconds (because of the RunResult overhead) while it was supposed to check the status once every second. With unlucky timing, this could then lead to a situation where the job has already finished on the server, but wait_for_results() returns APITimeoutError long after that.

This MR fixes the problem by using get_run_status() instead of get_run() to check the status in wait_for_results() and wait_for_compilation(), so that only RunStatus is polled, not RunResult.

@jkotilahti jkotilahti merged commit 4285cae into main Nov 8, 2023
10 checks passed
@jkotilahti jkotilahti deleted the comp-1166-fix-job-status-checks branch November 8, 2023 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants