Skip to content

Commit

Permalink
Revert shutdown behavior when kernel is dead, and change documentatio…
Browse files Browse the repository at this point in the history
…n 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.
  • Loading branch information
jasongrout committed May 15, 2019
1 parent 0743bb2 commit 8ea8e92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/services/src/kernel/default.ts
Expand Up @@ -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<void> {
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();
Expand Down

0 comments on commit 8ea8e92

Please sign in to comment.