lava_rpc_connector: block_wait_for_jobs: Also handle OSError's
We had a case when TimeoutError was thrown during LAVA operation. Catch
base class, OSError, in case some other socker errors may occur either.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: I32c40d031ff758f5e813de58a554663f097f2963
diff --git a/tfm_ci_pylib/lava_rpc_connector.py b/tfm_ci_pylib/lava_rpc_connector.py
index 1b88826..72864a8 100644
--- a/tfm_ci_pylib/lava_rpc_connector.py
+++ b/tfm_ci_pylib/lava_rpc_connector.py
@@ -248,11 +248,12 @@
# Check if the job is not running
try:
cur_status = self.get_job_info(job_id)
- except xmlrpc.client.ProtocolError as e:
+ except (xmlrpc.client.ProtocolError, OSError) as e:
# There can be transient HTTP errors, e.g. "502 Proxy Error"
+ # or socket timeout.
# Just continue with the next job, the faulted one will be
# re-checked on next iteration.
- _log.warning("block_wait_for_jobs: xmlrpc.client.ProtocolError %s occurred, ignore and continue", e.errmsg)
+ _log.warning("block_wait_for_jobs: %r occurred, ignore and continue", e)
time.sleep(2)
continue
# If in queue or running wait