Skip to content

Commit a56cc3c

Browse files
committed
FIX: Avoid retrying once if retry prevented in Child.ask
skipci
1 parent d1d89e2 commit a56cc3c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

octue/resources/child.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def ask(
105105
:param float|int maximum_heartbeat_interval: the maximum amount of time (in seconds) allowed between child heartbeats before an error is raised
106106
:raise TimeoutError: if the timeout is exceeded while waiting for an answer
107107
:raise Exception: if the question raises an error and `raise_errors=True`
108-
:return dict|octue.cloud.pub_sub.subscription.Subscription|Exception|None, str: for a synchronous question, a dictionary containing the keys "output_values" and "output_manifest" from the result, and the question UUID; for a question with a push endpoint, the push subscription and the question UUID; for an asynchronous question, `None` and the question UUID
108+
:return dict|octue.cloud.pub_sub.subscription.Subscription|Exception|None, str: for a synchronous question, a dictionary containing the keys "output_values" and "output_manifest" from the result (or just an exception if the question fails), and the question UUID; for a question with a push endpoint, the push subscription and the question UUID; for an asynchronous question, `None` and the question UUID
109109
"""
110110
prevent_retries_when = prevent_retries_when or []
111111

@@ -153,6 +153,9 @@ def ask(
153153
if raise_errors:
154154
raise e
155155

156+
if type(e) in prevent_retries_when:
157+
return e, question_uuid
158+
156159
for retry in range(max_retries):
157160
logger.info("Retrying question %r %d of %d times.", question_uuid, retry + 1, max_retries)
158161

0 commit comments

Comments
 (0)