From 8ea8e925b6619683c0e1e5a711daf34b978a4f83 Mon Sep 17 00:00:00 2001 From: Jason Grout Date: Wed, 15 May 2019 03:23:11 -0700 Subject: [PATCH] Revert shutdown behavior when kernel is dead, and change documentation to match existing behavior. Throwing an error when shutting down a dead kernel causes a lot of test failures. So we keep the existing behavior and update the documentation, rather than changing the behavior to match the documentation. --- packages/services/src/kernel/default.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/services/src/kernel/default.ts b/packages/services/src/kernel/default.ts index d541a5003f52..679d98568117 100644 --- a/packages/services/src/kernel/default.ts +++ b/packages/services/src/kernel/default.ts @@ -377,14 +377,14 @@ export class DefaultKernel implements Kernel.IKernel { * On a valid response, closes the websocket and disposes of the kernel * object, and fulfills the promise. * - * The promise will be rejected if the kernel status is `dead` or if the - * request fails or the response is invalid. + * If the kernel is already `dead`, it closes the websocket and returns + * without a server request. */ async shutdown(): Promise { if (this.status === 'dead') { this._clearSocket(); await this._clearState(); - throw new Error('Kernel is dead'); + return; } await Private.shutdownKernel(this.id, this.serverSettings); await this._clearState();