Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Do not poll for runtime job completion #117

Closed
renier opened this issue Sep 29, 2021 · 2 comments · Fixed by Qiskit/qiskit-ibm-runtime#33
Closed

Do not poll for runtime job completion #117

renier opened this issue Sep 29, 2021 · 2 comments · Fixed by Qiskit/qiskit-ibm-runtime#33
Assignees
Labels
priority: high type: enhancement Existing functionality improvement

Comments

@renier
Copy link
Collaborator

renier commented Sep 29, 2021

What is the expected enhancement?

For runtime jobs, job.result() checks whether the job completed or not, and keeps polling the API if it is not completed yet.

This is inefficient though, causing many requests to the API and flooding logs repetitively. In the case of a runtime job, they can run for a lot longer than the usual circuits jobs. So this polling can go on for a while.

It is possible to use the /stream endpoint which is a websocket server. If the job is still running, the websocket server will keep the stream open. Once the job has completed, the websocket server will terminate the connection. It's not possible to open a stream if the job is completed already. So if there are network errors, the client can retry connecting to the websocket until it sees the message Job is not running... along with a 302 status.

@renier renier added the type: enhancement Existing functionality improvement label Sep 29, 2021
@jyu00
Copy link
Collaborator

jyu00 commented Sep 29, 2021

@renier Does this work for programs that don't provide interim results? I guess the stream would just be left open with no data transmission?

@renier
Copy link
Collaborator Author

renier commented Sep 29, 2021 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: high type: enhancement Existing functionality improvement
Projects
None yet
4 participants