Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled promise rejection in future.js of @jupyterlab/services #4790

Closed
alexeckert opened this issue Jun 27, 2018 · 2 comments
Closed

Unhandled promise rejection in future.js of @jupyterlab/services #4790

alexeckert opened this issue Jun 27, 2018 · 2 comments
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.

Comments

@alexeckert
Copy link

alexeckert commented Jun 27, 2018

Using v 2.0.3, when calling kernel.dispose() an unhandled future rejection might occur in node_modules/@jupyterlab/services/lib/kernel/future.js:155.

I've looked at the code, and it seems that there is some code which just tries to catch the rejected promise: See this._done.promise.catch(() => { /* no-op */ }); here https://github.com/jupyterlab/jupyterlab/blob/master/packages/services/src/kernel/future.ts#L162

However when I look at the transpiled future.js, this part is missing, which leads to unhandled promise rejections.

    KernelFutureHandler.prototype.dispose = function () {
        this._stdin = Private.noOp;
        this._iopub = Private.noOp;
        this._reply = Private.noOp;
        if (!this._testFlag(Private.KernelFutureFlag.IsDone)) {
            this._done.reject(new Error('Canceled'));
        }
        _super.prototype.dispose.call(this);
    };
@afshin
Copy link
Member

afshin commented Jun 27, 2018

This should be resolved with the merging of #4697 so the resolution will appear in our next release.

@jtpio
Copy link
Member

jtpio commented Sep 27, 2018

I've seen something similar recently after using ClientSession to start Python kernels (on 0.34.10).

It also happens on master (tested on commit 98b4e6a).

There seems to be different ways to reproduce this by just starting consoles. Sometimes it happens right after a fresh start:

kernel_future

Another way would be:

  1. Open a Python file
  2. Create Console for Editor
  3. Wait for the console to be ready
  4. Refresh the whole webpage (Empty Cache and Hard Reload)
  5. Wait for a few seconds

error_kernel_future_2

Stacktrace for reference

future.ts:174 Uncaught (in promise) Error: Canceled
    at KernelFutureHandler.dispose (future.ts:174)
    at _futures.forEach.future (default.ts:858)
    at Map.forEach (<anonymous>)
    at DefaultKernel._clearState (default.ts:857)
    at DefaultKernel.dispose (default.ts:231)
    at DefaultSession.dispose (default.ts:218)
    at editorTracker.forEach.file (index.ts:201)
    at algorithm_1.each.widget (instancetracker.ts:268)
    at Object.each (iter.js:60)
    at InstanceTracker.forEach (instancetracker.ts:267)

@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Aug 8, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

No branches or pull requests

3 participants