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

Allow users to indicate they are done submitting jobs to a session #1123

Closed
wants to merge 18 commits into from

Conversation

kt474
Copy link
Member

@kt474 kt474 commented Oct 3, 2023

Summary

WIP: PR is branched from #1119, so ideally that is merged first

  • Re-purposed session.close() to indicate one is done submitting to the session by using accepting_jobs = false.
  • New method session.cancel() terminates all jobs inside a session (this is the old close method, still calls /close).
  • session.close() is called upon exiting session in context manager

Details and comments

Fixes #1008

@coveralls
Copy link

coveralls commented Oct 3, 2023

Pull Request Test Coverage Report for Build 6451540490

  • 28 of 39 (71.79%) changed or added relevant lines in 5 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.09%) to 74.692%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit_ibm_runtime/api/clients/runtime.py 2 3 66.67%
qiskit_ibm_runtime/api/rest/base.py 10 14 71.43%
qiskit_ibm_runtime/api/rest/runtime_session.py 9 15 60.0%
Files with Coverage Reduction New Missed Lines %
qiskit_ibm_runtime/api/clients/runtime.py 1 54.79%
qiskit_ibm_runtime/session.py 1 98.81%
Totals Coverage Status
Change from base Build 6397643118: -0.09%
Covered Lines: 2547
Relevant Lines: 3410

💛 - Coveralls

@kt474 kt474 added the Changelog: New Feature Include in the Added section of the changelog label Oct 4, 2023
@kt474 kt474 marked this pull request as ready for review October 9, 2023 00:03

.. warning::
Close a session only after all session jobs **complete**, rather than immediately after they have all been submitted. Session jobs that are not completed will fail.
When a session that is not accepting jobs has run out of jobs to run, it is immediately closed.

Copy link
Member Author

Choose a reason for hiding this comment

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

@beckykd should docs updates be in a separate PR? I'll probably need help with the wording on a lot of these - it will also be a bit tricky since once this is released, older versions of qiskit-ibm-runtime will behave differently

@kt474
Copy link
Member Author

kt474 commented Oct 9, 2023

closing this and reopening on a fresh branch since this no longer depends on a different PR

@kt474 kt474 closed this Oct 9, 2023
@kt474 kt474 deleted the session-accepting-jobs branch October 9, 2023 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the Added section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow users to indicate they are done submitting jobs to a session
2 participants