From 125de9e48fef580abb1f5bc7802f92676b6f00ac Mon Sep 17 00:00:00 2001 From: Adam Sussman Date: Wed, 13 Jan 2021 21:08:41 -0800 Subject: [PATCH] move scope of timeout_thread to where it can be seen by the finally clause --- sentry_sdk/integrations/aws_lambda.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentry_sdk/integrations/aws_lambda.py b/sentry_sdk/integrations/aws_lambda.py index 6cb42a9790..79135c736b 100644 --- a/sentry_sdk/integrations/aws_lambda.py +++ b/sentry_sdk/integrations/aws_lambda.py @@ -101,6 +101,7 @@ def sentry_handler(aws_event, aws_context, *args, **kwargs): configured_time = aws_context.get_remaining_time_in_millis() with hub.push_scope() as scope: + timeout_thread = None with capture_internal_exceptions(): scope.clear_breadcrumbs() scope.add_event_processor( @@ -115,7 +116,6 @@ def sentry_handler(aws_event, aws_context, *args, **kwargs): scope.set_tag("batch_request", True) scope.set_tag("batch_size", batch_size) - timeout_thread = None # Starting the Timeout thread only if the configured time is greater than Timeout warning # buffer and timeout_warning parameter is set True. if (