Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions compute_worker/compute_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,8 @@ def __init__(self, run_args):
max_retries=Retry(
total=3,
Comment thread
dconstancy marked this conversation as resolved.
backoff_factor=1,
status_forcelist=[502, 503, 504],
allowed_methods=["PATCH", "GET", "PUT"],
)
)
self.requests_session.mount("http://", adapter)
Expand Down Expand Up @@ -618,7 +620,7 @@ def _update_submission(self, data):
url = f"{self.submissions_api_url}/submissions/{self.submission_id}/"
data["secret"] = self.secret

logger.info(f"Updating submission @ {url} with data = {data}")
logger.info(f"Updating submission @ {url}")

resp = self.requests_session.patch(url, data=data, timeout=150)
if resp.status_code == 200:
Expand All @@ -639,8 +641,10 @@ def _update_status(self, status, extra_information=None):
try:
self._update_submission(data)
except Exception as e:
# Always catch exception and never raise error
Comment thread
dconstancy marked this conversation as resolved.
# Re-raise only for terminal statuses so Celery marks the task as failed.
logger.exception(f"Failed to update submission status to {status}: {e}")
if status in ("Finished", "Failed"):
raise

def _get_container_image(self, image_name):
logger.info("Running pull for image: {}".format(image_name))
Expand Down