From 991001a7dc2c973056f2788e015c3118eeab8256 Mon Sep 17 00:00:00 2001 From: Jonny Burger Date: Fri, 14 Jun 2024 08:39:29 +0200 Subject: [PATCH] `@remotion/lambda`: Disable slow leak detection Previously it was partially disabled, but still it can lead to a unfortunate race condition if another Lambda function is launched exactly 10 seconds after the previous one. --- packages/lambda/src/functions/renderer.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/lambda/src/functions/renderer.ts b/packages/lambda/src/functions/renderer.ts index 8e15291dfa3..a260625af2f 100644 --- a/packages/lambda/src/functions/renderer.ts +++ b/packages/lambda/src/functions/renderer.ts @@ -442,6 +442,8 @@ export const rendererHandler = async ( } finally { forgetBrowserEventLoop(params.logLevel); - startLeakDetection(leakDetection, requestContext.awsRequestId); + if (ENABLE_SLOW_LEAK_DETECTION) { + startLeakDetection(leakDetection, requestContext.awsRequestId); + } } };