From f850104c0dc2f3b9dd3e00198d31bb0dc6f96c32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Negr=C3=B3n?= Date: Wed, 23 Oct 2024 18:28:37 -0400 Subject: [PATCH] switch strategy into force exiting --- packages/core/src/tools/create-lambda-handler.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/core/src/tools/create-lambda-handler.js b/packages/core/src/tools/create-lambda-handler.js index 805dc0c18..aeac07748 100644 --- a/packages/core/src/tools/create-lambda-handler.js +++ b/packages/core/src/tools/create-lambda-handler.js @@ -196,13 +196,18 @@ const createLambdaHandler = (appRawOrPath) => { ZapierPromise.patchGlobal(); } - // If we're running out of memory, exit the process. Backend will try again. + // If we're running out of memory or file descriptors, force exit the process. + // The backend will try again via @retry(ProcessExitedException). try { checkMemory(event); } catch (err) { - // Don't crash the invocation if we can't check memory usage. if (err.code === 'EMFILE') { - console.error('Too many open files, skipping memory usage check...'); + console.error( + 'Force killing process by Zapier for too many open file descriptors' + ); + + /* eslint no-process-exit: 0 */ + process.exit(1); } else { throw err; }