diff --git a/tasks/bundle_analysis_processor.py b/tasks/bundle_analysis_processor.py index 83af4fbe8..de175d165 100644 --- a/tasks/bundle_analysis_processor.py +++ b/tasks/bundle_analysis_processor.py @@ -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 @@ -195,18 +194,10 @@ def process_impl_within_lock( result.update_upload(carriedforward=carriedforward) processing_results.append(result.as_dict()) - 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(