From 06f625c5d8bba13e104ee636274c5dc07f42d5ae Mon Sep 17 00:00:00 2001 From: Arpad Borsos Date: Mon, 2 Sep 2024 15:40:43 +0200 Subject: [PATCH] Remove double-`async_to_sync` The `save_parallel_report_to_archive` function was recently refactored to not be `async` anymore. However the `async_to_sync` wrapper was still doing its job, running the function in an async context on a background thread. This has lead to an error inside that function which was also calling `async_to_sync` internally. Fixes WORKER-P4B --- tasks/upload_finisher.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tasks/upload_finisher.py b/tasks/upload_finisher.py index 3cae3153d..2c9372334 100644 --- a/tasks/upload_finisher.py +++ b/tasks/upload_finisher.py @@ -5,7 +5,6 @@ from concurrent.futures import ThreadPoolExecutor from enum import Enum -from asgiref.sync import async_to_sync from redis.exceptions import LockError from shared.celery_config import ( compute_comparison_task_name, @@ -170,9 +169,9 @@ def run_impl( ) with metrics.timer(f"{self.metrics_prefix}.save_parallel_report_results"): - parallel_paths = async_to_sync( - report_service.save_parallel_report_to_archive - )(commit, report, report_code) + parallel_paths = report_service.save_parallel_report_to_archive( + commit, report, report_code + ) # now that we've built the report and stored it to GCS, we have what we need to # compare the results with the current upload pipeline. We end execution of the # finisher task here so that we don't cause any additional side-effects