diff --git a/patches/sagemaker.series b/patches/sagemaker.series index bc82a96..61885cf 100644 --- a/patches/sagemaker.series +++ b/patches/sagemaker.series @@ -48,3 +48,4 @@ sagemaker/display-both-versions-in-about.diff sagemaker/validate-http-request-referer.diff sagemaker/sanitize-terminal-sendtext-paths.diff sagemaker/override-picomatch-post-startup-notifications.diff +sagemaker/remove-delay-shutdown-endpoint.diff diff --git a/patches/sagemaker/remove-delay-shutdown-endpoint.diff b/patches/sagemaker/remove-delay-shutdown-endpoint.diff new file mode 100644 index 0000000..6a88563 --- /dev/null +++ b/patches/sagemaker/remove-delay-shutdown-endpoint.diff @@ -0,0 +1,44 @@ +Remove unused delay-shutdown REST endpoint + +Remove the /delay-shutdown HTTP endpoint and its _delayShutdown() method +from remoteExtensionHostAgentServer. This feature is not used by the +service and the shutdown lifecycle is fully managed by the extension host +connection events. + +Index: code-editor-src/src/vs/server/node/remoteExtensionHostAgentServer.ts +=================================================================== +--- code-editor-src.orig/src/vs/server/node/remoteExtensionHostAgentServer.ts ++++ code-editor-src/src/vs/server/node/remoteExtensionHostAgentServer.ts +@@ -158,13 +158,6 @@ class RemoteExtensionHostAgentServer ext + return void res.end(this._productService.commit || ''); + } + +- // Delay shutdown +- if (pathname === '/delay-shutdown') { +- this._delayShutdown(); +- res.writeHead(200); +- return void res.end('OK'); +- } +- + if (!httpRequestHasValidConnectionToken(this._connectionToken, req, parsedUrl)) { + // invalid connection token + return serveError(req, res, 403, `Forbidden.`); +@@ -630,18 +623,6 @@ class RemoteExtensionHostAgentServer ext + } + } + +- /** +- * If the server is in a shutdown timeout, cancel it and start over +- */ +- private _delayShutdown(): void { +- if (this.shutdownTimer) { +- console.log('Got delay-shutdown request while in shutdown timeout, delaying'); +- this._logService.info('Got delay-shutdown request while in shutdown timeout, delaying'); +- this._cancelShutdown(); +- this._waitThenShutdown(); +- } +- } +- + private _cancelShutdown(): void { + if (this.shutdownTimer) { + console.log('Cancelling previous shutdown timeout');