From d6f6ef4b0b0c3e0782ede504230ba3aecbf41c2e Mon Sep 17 00:00:00 2001 From: Edoardo Pirovano Date: Wed, 9 Nov 2022 17:08:44 +0000 Subject: [PATCH] Force exit of process if a timeout has occurred --- lib/analyze-action.js | 2 ++ lib/analyze-action.js.map | 2 +- lib/util.js | 35 ++++++++++++++++++++++++++++++++--- lib/util.js.map | 2 +- src/analyze-action.ts | 2 ++ src/util.ts | 36 ++++++++++++++++++++++++++++++++++-- 6 files changed, 72 insertions(+), 7 deletions(-) diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 8c95a6d7e8..d3b9a2f43b 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -42,6 +42,7 @@ const repository_1 = require("./repository"); const trap_caching_1 = require("./trap-caching"); const upload_lib = __importStar(require("./upload-lib")); const util = __importStar(require("./util")); +const util_1 = require("./util"); // eslint-disable-next-line import/no-commonjs const pkg = require("../package.json"); async function sendStatusReport(startedAt, config, stats, error, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, logger) { @@ -238,6 +239,7 @@ async function runWrapper() { core.setFailed(`analyze action failed: ${error}`); console.log(error); } + await (0, util_1.checkForTimeout)(); } void runWrapper(); //# sourceMappingURL=analyze-action.js.map \ No newline at end of file diff --git a/lib/analyze-action.js.map b/lib/analyze-action.js.map index 94ccd4440d..95db8659da 100644 --- a/lib/analyze-action.js.map +++ b/lib/analyze-action.js.map @@ -1 +1 @@ -{"version":3,"file":"analyze-action.js","sourceRoot":"","sources":["../src/analyze-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,gDAAwB;AACxB,6CAA6C;AAC7C,2CAAyC;AAEzC,oDAAsC;AAEtC,4DAA8C;AAE9C,uCAMmB;AACnB,6CAA0E;AAC1E,2CAA2C;AAC3C,qCAAqC;AACrC,iDAAmD;AACnD,uDAAoD;AACpD,mDAA8D;AAC9D,2CAAuC;AACvC,uCAAqD;AACrD,6CAAkD;AACl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;SACH;aAAM;YACL,MAAM,gBAAgB,CACpB,SAAS,EACT,MAAM,EACN,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;SACH;QAED,OAAO;KACR;IAED,IAAI,QAAQ,IAAI,YAAY,EAAE;QAC5B,MAAM,gBAAgB,CACpB,SAAS,EACT,MAAM,EACN;YACE,GAAG,QAAQ;YACX,GAAG,YAAY,CAAC,YAAY;SAC7B,EACD,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;KACH;SAAM,IAAI,QAAQ,EAAE;QACnB,MAAM,gBAAgB,CACpB,SAAS,EACT,MAAM,EACN,EAAE,GAAG,QAAQ,EAAE,EACf,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;KACH;SAAM;QACL,MAAM,gBAAgB,CACpB,SAAS,EACT,MAAM,EACN,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;KACH;AACH,CAAC;AAEY,QAAA,UAAU,GAAG,GAAG,EAAE,CAAC;AAEhC,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,kBAAU,CAAC;KAClB;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,0BAA0B,KAAK,EAAE,CAAC,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACpB;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"analyze-action.js","sourceRoot":"","sources":["../src/analyze-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,gDAAwB;AACxB,6CAA6C;AAC7C,2CAAyC;AAEzC,oDAAsC;AAEtC,4DAA8C;AAE9C,uCAMmB;AACnB,6CAA0E;AAC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AAC;YAC/C,MAAM,gBAAgB,CACpB,SAAS,EACT,MAAM,EACN,KAAK,EACL,KAAK,EACL,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;SACH;aAAM;YACL,MAAM,gBAAgB,CACpB,SAAS,EACT,MAAM,EACN,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;SACH;QAED,OAAO;KACR;IAED,IAAI,QAAQ,IAAI,YAAY,EAAE;QAC5B,MAAM,gBAAgB,CACpB,SAAS,EACT,MAAM,EACN;YACE,GAAG,QAAQ;YACX,GAAG,YAAY,CAAC,YAAY;SAC7B,EACD,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;KACH;SAAM,IAAI,QAAQ,EAAE;QACnB,MAAM,gBAAgB,CACpB,SAAS,EACT,MAAM,EACN,EAAE,GAAG,QAAQ,EAAE,EACf,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;KACH;SAAM;QACL,MAAM,gBAAgB,CACpB,SAAS,EACT,MAAM,EACN,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;KACH;AACH,CAAC;AAEY,QAAA,UAAU,GAAG,GAAG,EAAE,CAAC;AAEhC,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,kBAAU,CAAC;KAClB;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,0BAA0B,KAAK,EAAE,CAAC,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACpB;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/lib/util.js b/lib/util.js index b2a7e1da18..bc33feb101 100644 --- a/lib/util.js +++ b/lib/util.js @@ -22,7 +22,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.isHostedRunner = exports.withTimeout = exports.tryGetFolderBytes = exports.isGoExtractionReconciliationEnabled = exports.listFolder = exports.doesDirectoryExist = exports.logCodeScanningConfigInCli = exports.useCodeScanningConfigInCli = exports.isInTestMode = exports.checkActionVersion = exports.getMlPoweredJsQueriesStatus = exports.getMlPoweredJsQueriesPack = exports.ML_POWERED_JS_QUERIES_PACK_NAME = exports.isGoodVersion = exports.delay = exports.bundleDb = exports.codeQlVersionAbove = exports.getCachedCodeQlVersion = exports.cacheCodeQlVersion = exports.isHTTPError = exports.UserError = exports.HTTPError = exports.getRequiredEnvParam = exports.isActions = exports.getMode = exports.enrichEnvironment = exports.initializeEnvironment = exports.EnvVar = exports.Mode = exports.assertNever = exports.getGitHubAuth = exports.apiVersionInRange = exports.DisallowedAPIVersionReason = exports.checkGitHubVersionInRange = exports.getGitHubVersion = exports.GitHubVariant = exports.parseGitHubUrl = exports.getCodeQLDatabasePath = exports.getThreadsFlag = exports.getThreadsFlagValue = exports.getAddSnippetsFlag = exports.getMemoryFlag = exports.getMemoryFlagValue = exports.withTmpDir = exports.getToolNames = exports.getExtraOptionsEnvParam = exports.DID_AUTOBUILD_GO_ENV_VAR_NAME = exports.DEFAULT_DEBUG_DATABASE_NAME = exports.DEFAULT_DEBUG_ARTIFACT_NAME = exports.GITHUB_DOTCOM_URL = void 0; +exports.checkForTimeout = exports.withTimeout = exports.tryGetFolderBytes = exports.isGoExtractionReconciliationEnabled = exports.listFolder = exports.doesDirectoryExist = exports.logCodeScanningConfigInCli = exports.useCodeScanningConfigInCli = exports.isInTestMode = exports.checkActionVersion = exports.getMlPoweredJsQueriesStatus = exports.getMlPoweredJsQueriesPack = exports.ML_POWERED_JS_QUERIES_PACK_NAME = exports.isGoodVersion = exports.delay = exports.bundleDb = exports.codeQlVersionAbove = exports.getCachedCodeQlVersion = exports.cacheCodeQlVersion = exports.isHTTPError = exports.UserError = exports.HTTPError = exports.getRequiredEnvParam = exports.isActions = exports.getMode = exports.enrichEnvironment = exports.initializeEnvironment = exports.EnvVar = exports.Mode = exports.assertNever = exports.getGitHubAuth = exports.apiVersionInRange = exports.DisallowedAPIVersionReason = exports.checkGitHubVersionInRange = exports.getGitHubVersion = exports.GitHubVariant = exports.parseGitHubUrl = exports.getCodeQLDatabasePath = exports.getThreadsFlag = exports.getThreadsFlagValue = exports.getAddSnippetsFlag = exports.getMemoryFlag = exports.getMemoryFlagValue = exports.withTmpDir = exports.getToolNames = exports.getExtraOptionsEnvParam = exports.DID_AUTOBUILD_GO_ENV_VAR_NAME = exports.DEFAULT_DEBUG_DATABASE_NAME = exports.DEFAULT_DEBUG_ARTIFACT_NAME = exports.GITHUB_DOTCOM_URL = void 0; +exports.isHostedRunner = void 0; const fs = __importStar(require("fs")); const os = __importStar(require("os")); const path = __importStar(require("path")); @@ -719,13 +720,21 @@ async function tryGetFolderBytes(cacheDir, logger) { } } exports.tryGetFolderBytes = tryGetFolderBytes; +let hadTimeout = false; /** * Run a promise for a given amount of time, and if it doesn't resolve within - * that time, call the provided callback and then return undefined. + * that time, call the provided callback and then return undefined. Due to the + * limitation outlined below, using this helper function is not recommended + * unless there is no other option for adding a timeout (e.g. the code that + * would need the timeout added is an external library). * * Important: This does NOT cancel the original promise, so that promise will * continue in the background even after the timeout has expired. If the * original promise hangs, then this will prevent the process terminating. + * If a timeout has occurred then the global hadTimeout variable will get set + * to true, and the caller is responsible for forcing the process to exit + * if this is the case by calling the `checkForTimeout` function at the end + * of execution. * * @param timeoutMs The timeout in milliseconds. * @param promise The promise to run. @@ -741,14 +750,34 @@ async function withTimeout(timeoutMs, promise, onTimeout) { }; const timeout = new Promise((resolve) => { setTimeout(() => { - if (!finished) + if (!finished) { + // Workaround: While the promise racing below will allow the main code + // to continue, the process won't normally exit until the asynchronous + // task in the background has finished. We set this variable to force + // an exit at the end of our code when `checkForTimeout` is called. + hadTimeout = true; onTimeout(); + } resolve(undefined); }, timeoutMs); }); return await Promise.race([mainTask(), timeout]); } exports.withTimeout = withTimeout; +/** + * Check if the global hadTimeout variable has been set, and if so then + * exit the process to ensure any background tasks that are still running + * are killed. This should be called at the end of execution if the + * `withTimeout` function has been used. + */ +async function checkForTimeout() { + if (hadTimeout === true) { + core.info("A timeout occurred, force exiting the process after 30 seconds to prevent hanging."); + await delay(30000); + process.exit(); + } +} +exports.checkForTimeout = checkForTimeout; /** * This function implements a heuristic to determine whether the * runner we are on is hosted by GitHub. It does this by checking diff --git a/lib/util.js.map b/lib/util.js.map index 69fbe07966..59d0fe19aa 100644 --- a/lib/util.js.map +++ b/lib/util.js.map @@ -1 +1 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAE7B,+BAAiC;AAEjC,oDAAsC;AACtC,8CAAsB;AACtB,sEAA4C;AAC5C,+CAAiC;AAEjC,kDAAoC;AACpC,6CAA8D;AAC9D,2EAA6D;AAC7D,qCAA8D;AAC9D,iDAIwB;AACxB,mDAA6D;AAI7D;;;GAGG;AACH,MAAM,eAAe,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAE3C;;GAEG;AACU,QAAA,iBAAiB,GAAG,oBAAoB,CAAC;AAEtD;;GAEG;AACU,QAAA,2BAA2B,GAAG,iBAAiB,CAAC;AAE7D;;GAEG;AACU,QAAA,2BAA2B,GAAG,IAAI,CAAC;AAEhD;;;GAGG;AACU,QAAA,6BAA6B,GACxC,oCAAoC,CAAC;AAyCvC;;GAEG;AACH,SAAgB,uBAAuB;IACrC,MAAM,OAAO,GAAG,6BAA6B,CAAC;IAC9C,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACjC,IAAI,G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0CAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAA;;QACtD,8DAA8D;QAC9D,MAAA,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,0CAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAA,CAC9D,CAAC;AACJ,CAAC;AATD,wCASC"} \ No newline at end of file diff --git a/src/analyze-action.ts b/src/analyze-action.ts index 7ca5a2bd5e..9c660a3a85 100644 --- a/src/analyze-action.ts +++ b/src/analyze-action.ts @@ -27,6 +27,7 @@ import { getTotalCacheSize, uploadTrapCaches } from "./trap-caching"; import * as upload_lib from "./upload-lib"; import { UploadResult } from "./upload-lib"; import * as util from "./util"; +import { checkForTimeout } from "./util"; // eslint-disable-next-line import/no-commonjs const pkg = require("../package.json"); @@ -402,6 +403,7 @@ async function runWrapper() { core.setFailed(`analyze action failed: ${error}`); console.log(error); } + await checkForTimeout(); } void runWrapper(); diff --git a/src/util.ts b/src/util.ts index 476ea8eaf2..6df1379cbb 100644 --- a/src/util.ts +++ b/src/util.ts @@ -858,13 +858,22 @@ export async function tryGetFolderBytes( } } +let hadTimeout = false; + /** * Run a promise for a given amount of time, and if it doesn't resolve within - * that time, call the provided callback and then return undefined. + * that time, call the provided callback and then return undefined. Due to the + * limitation outlined below, using this helper function is not recommended + * unless there is no other option for adding a timeout (e.g. the code that + * would need the timeout added is an external library). * * Important: This does NOT cancel the original promise, so that promise will * continue in the background even after the timeout has expired. If the * original promise hangs, then this will prevent the process terminating. + * If a timeout has occurred then the global hadTimeout variable will get set + * to true, and the caller is responsible for forcing the process to exit + * if this is the case by calling the `checkForTimeout` function at the end + * of execution. * * @param timeoutMs The timeout in milliseconds. * @param promise The promise to run. @@ -884,7 +893,14 @@ export async function withTimeout( }; const timeout: Promise = new Promise((resolve) => { setTimeout(() => { - if (!finished) onTimeout(); + if (!finished) { + // Workaround: While the promise racing below will allow the main code + // to continue, the process won't normally exit until the asynchronous + // task in the background has finished. We set this variable to force + // an exit at the end of our code when `checkForTimeout` is called. + hadTimeout = true; + onTimeout(); + } resolve(undefined); }, timeoutMs); }); @@ -892,6 +908,22 @@ export async function withTimeout( return await Promise.race([mainTask(), timeout]); } +/** + * Check if the global hadTimeout variable has been set, and if so then + * exit the process to ensure any background tasks that are still running + * are killed. This should be called at the end of execution if the + * `withTimeout` function has been used. + */ +export async function checkForTimeout() { + if (hadTimeout === true) { + core.info( + "A timeout occurred, force exiting the process after 30 seconds to prevent hanging." + ); + await delay(30_000); + process.exit(); + } +} + /** * This function implements a heuristic to determine whether the * runner we are on is hosted by GitHub. It does this by checking