[elbe-devel] [PATCH] elbepack: soapclient: bound retries in wait_busy
Thomas Weißschuh
thomas.weissschuh at linutronix.de
Thu Nov 21 14:07:36 CET 2024
Busy retrying forever is not really useful.
Instead reuse the retry configuration and logic from the connection
phase.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
elbepack/soapclient.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/elbepack/soapclient.py b/elbepack/soapclient.py
index 52787f9225dbaf5d65ffb978c782230358af629e..cd40e2d12def223d7163fc23c2a81c38ac0dc0de 100644
--- a/elbepack/soapclient.py
+++ b/elbepack/soapclient.py
@@ -125,7 +125,9 @@ class ElbeSoapClient:
break
def wait_busy(self, project_dir):
+ current_retries = 0
while True:
+ current_retries += 1
try:
msg = self.service.get_project_busy(project_dir)
# TODO the root cause of this problem is unclear. To enable a
@@ -134,7 +136,10 @@ class ElbeSoapClient:
# code should be reworked as soon as it's clear what is going on
# here
except socket.error:
+ if current_retries > self._retries:
+ raise
_logger.warn('socket error during wait busy occured, retry..', exc_info=True)
+ time.sleep(1)
continue
if not msg:
---
base-commit: 517e38aac8a65346030e871da7789ce7447cbc49
change-id: 20241121-wait_busy-retries-8050c521b319
Best regards,
--
Thomas Weißschuh <thomas.weissschuh at linutronix.de>
More information about the elbe-devel
mailing list