From d8a984c4a1c36aa9907655150251397872b351b8 Mon Sep 17 00:00:00 2001 From: kevin-tian Date: Sun, 8 Oct 2023 20:01:13 -0400 Subject: [PATCH] add reno --- qiskit_ibm_runtime/session.py | 2 +- .../sessions-accepting-jobs-d77e3bba150a20f5.yaml | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/sessions-accepting-jobs-d77e3bba150a20f5.yaml diff --git a/qiskit_ibm_runtime/session.py b/qiskit_ibm_runtime/session.py index a586c3e4f..ec82fba28 100644 --- a/qiskit_ibm_runtime/session.py +++ b/qiskit_ibm_runtime/session.py @@ -190,7 +190,7 @@ def close(self) -> None: queued or running jobs will run to completion. The session will be closed when there are no more jobs to run.""" backend = self._service.backend(self._backend) - # There is a 500 internal error on IQP when the backend is a simulator + # There is a 500 internal error on IQP if the backend is a simulator if not backend.simulator and self._session_id: self._service._api_client.close_session(self._session_id) diff --git a/releasenotes/notes/sessions-accepting-jobs-d77e3bba150a20f5.yaml b/releasenotes/notes/sessions-accepting-jobs-d77e3bba150a20f5.yaml new file mode 100644 index 000000000..de6d6a2ef --- /dev/null +++ b/releasenotes/notes/sessions-accepting-jobs-d77e3bba150a20f5.yaml @@ -0,0 +1,14 @@ +--- +upgrade: + - | + :meth:`qiskit_ibm_runtime.Session.close` has been updated to mark a ``Session`` as no longer + accepting new jobs. The session won't accept more jobs but it will continue to run any + queued jobs until they are done or the max time expires. This will also happen + automatically when the session context manager is exited. When a session that is not accepting + jobs has run out of jobs to run, it's immediately closed, freeing up the backend to run more jobs rather + than wait for the interactive timeout. + + The old close method behaviour has been moved to a new method, + :meth:`qiskit_ibm_runtime.Session.cancel`, where all jobs within a session are + cancelled and terminated. +