From 0f9cc6f57e2d1911d13e613a5931d63f69fdd3e0 Mon Sep 17 00:00:00 2001 From: Kevin Tian Date: Thu, 7 Dec 2023 18:58:53 -0500 Subject: [PATCH] Revert "Don't block for the first job in a session (#1170)" (#1267) * Revert "Don't block for the first job in a session (#1170)" This reverts commit f2e24e49829360af4381cb0ffc46f62e343054fa. * keep test --- qiskit_ibm_runtime/session.py | 6 +----- .../notes/backend-blocking-job-70ebcf44855cbdfd.yaml | 8 -------- 2 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 releasenotes/notes/backend-blocking-job-70ebcf44855cbdfd.yaml diff --git a/qiskit_ibm_runtime/session.py b/qiskit_ibm_runtime/session.py index 52c2f9a38..179b61886 100644 --- a/qiskit_ibm_runtime/session.py +++ b/qiskit_ibm_runtime/session.py @@ -23,7 +23,6 @@ from .runtime_job import RuntimeJob from .utils.result_decoder import ResultDecoder from .ibm_backend import IBMBackend -from .exceptions import RuntimeJobTimeoutError from .utils.default_session import set_cm_session from .utils.deprecation import deprecate_arguments @@ -181,10 +180,7 @@ def run( self._setup_lock.release() if self._backend is None: - try: - self._backend = job.backend(0).name - except RuntimeJobTimeoutError: - self._backend = None + self._backend = job.backend().name return job diff --git a/releasenotes/notes/backend-blocking-job-70ebcf44855cbdfd.yaml b/releasenotes/notes/backend-blocking-job-70ebcf44855cbdfd.yaml deleted file mode 100644 index c9cf202fb..000000000 --- a/releasenotes/notes/backend-blocking-job-70ebcf44855cbdfd.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -fixes: - - | - Fixed an issue where the first job in a cloud channel session without a backend passed - in would block other jobs from starting. This would happen because the first job would - attempt to retrieve the backend from the job which required the job to be in a - completed state. -