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

Poll status API after stream closes in wait_for_final_state until it is final #341

Merged
merged 2 commits into from
May 27, 2022

Conversation

rathishcholarajan
Copy link
Member

Summary

wait_for_final_state used to poll for status every x seconds.
This poll logic was a bit heavy on the server and hence PR #33 used the end of the results websocket stream to figure the end of the job, but there is a delay between when the stream closes and the status is updated in the db. So if status is queried in between that time it returns running. So as a short term fix until this is fixed on server side, we can poll for status after stream closes and until it is final.

Details and comments

Fixes #311
Also fixes this intermittent integration test failure due to this https://github.com/Qiskit/qiskit-ibm-runtime/runs/6585776699?check_suite_focus=true#step:5:1795

@coveralls
Copy link

coveralls commented May 26, 2022

Pull Request Test Coverage Report for Build 2397135270

  • 4 of 9 (44.44%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-3.2%) to 64.258%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit_ibm_runtime/runtime_job.py 4 9 44.44%
Totals Coverage Status
Change from base Build 2396400547: -3.2%
Covered Lines: 2517
Relevant Lines: 3917

💛 - Coveralls

Copy link
Member

@kt474 kt474 left a comment

Choose a reason for hiding this comment

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

LGTM as a short term fix
But I believe the point of the original PR was to remove polling - so it would be nice if there was a server side solution

@rathishcholarajan rathishcholarajan merged commit 03b27fc into Qiskit:main May 27, 2022
@rathishcholarajan rathishcholarajan added the Changelog: Bugfix Include in the Fixed section of the changelog label Jun 17, 2022
@rathishcholarajan rathishcholarajan added this to the 0.5.0 milestone Jun 20, 2022
@rathishcholarajan rathishcholarajan deleted the 311-poll-status branch June 29, 2022 19:31
blakejohnson pushed a commit to blakejohnson/qiskit-ibm-runtime that referenced this pull request May 26, 2023
* fix primiitives that use mthree 2.0

Additionlly, it supports mid-circuit measurements thanks to mthree 2.0

* enable mid-circuit measurements for sampler

* fix seed_mitigation of TREX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the Fixed section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

job.result() doesn't raise RuntimeJobFailureError for failed job
3 participants