Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.
Merged
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
17 changes: 4 additions & 13 deletions tasks/bundle_analysis_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from celery.exceptions import CeleryError, SoftTimeLimitExceeded
from shared.reports.enums import UploadState
from shared.yaml import UserYaml
from sqlalchemy.exc import SQLAlchemyError

from app import celery_app
from database.enums import ReportType
Expand Down Expand Up @@ -195,18 +194,10 @@ def process_impl_within_lock(
result.update_upload(carriedforward=carriedforward)

processing_results.append(result.as_dict())
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting SQLAlchemyError in the catch all.

except (CeleryError, SoftTimeLimitExceeded, SQLAlchemyError):
log.exception(
"Unable to process bundle analysis upload",
extra=dict(
repoid=repoid,
commit=commitid,
commit_yaml=commit_yaml,
params=params,
upload_id=upload.id_,
parent_task=self.request.parent_id,
),
)
except (CeleryError, SoftTimeLimitExceeded):
# This generally happens when the task needs to be retried because we attempt to access
# the upload before it is saved to GCS. Anecdotally, it takes around 30s for it to be
# saved, but if the BA processor runs before that we will error and need to retry.
raise
except Exception:
log.exception(
Expand Down
Loading