From 0d952b4d8c3ea97e95134c24b402e82dcf071441 Mon Sep 17 00:00:00 2001 From: David McDonald Date: Tue, 8 Mar 2022 13:05:32 +0000 Subject: [PATCH] Reduce timeout for service callback attempt to 5 seconds It is currently 60 seconds but we have had two incidents in the past week where there is a connection error talking to a service and the request takes up to 60 seconds before failing. When this happens, if there are a few of these callbacks then all of them will completely hog the service callback worker and build up a big queue of all the other service callbacks. 5 seconds has been chosen as that is still a pretty decent length time for a simple web request that should just be giving them a little bit of information for them to store. 5 seconds should be a sufficient enough reduction that we dramatically reduce this problem for the moment. Open to this number being changed in the future based on how we see it perform. --- app/celery/service_callback_tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/celery/service_callback_tasks.py b/app/celery/service_callback_tasks.py index 81ba876a9..9ba6ad0ad 100644 --- a/app/celery/service_callback_tasks.py +++ b/app/celery/service_callback_tasks.py @@ -68,7 +68,7 @@ def _send_data_to_service_callback_api(self, data, service_callback_url, token, 'Content-Type': 'application/json', 'Authorization': 'Bearer {}'.format(token) }, - timeout=60 + timeout=5 ) current_app.logger.info('{} sending {} to {}, response {}'.format( function_name,