Skip to content

Spurious warning: "Unmatched cancel notification" #1175

Open
@jbj

Description

@jbj

TL;DR: vscode-jsonrpc should be upgraded.

Describe the bug

Spurious warnings can appear in the "CodeQL Query Server" log when a query is cancelled. I just got the following message when I cancelled during query compilation, and we have a report of the same message during evaluation in an internal issue:

Mar 01, 2022 9:18:52 AM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
WARNING: Unmatched cancel notification for request id 8

There are sometimes bugs with cancellation in the CodeQL engine itself, and these spurious error messages can make it harder to pinpoint the problem, as evidenced in the internal issue.

@alexet wrote this on the internal issue:

Just for reference from previous investigations

WARNING: Unmatched cancel notification for request id 64

is a known benign bug in the old version of vscode-jsonrpc that we use where it forgets to listen to cancellation after completing a request. Upgrading vscode-jsonrpc should in theory fix it, but it came with quite a few other changes that made the upgrade non-trivial. The message means that we are still trying to cancel the compilation step but it is done.

Version

CLI 2.8.1, extension 1.5.9 for VSCode 1.64.2. I'm on Linux, and the other bug report came from a Mac user.

To reproduce

Look at the "CodeQL Query Server" log output. Start a query and cancel it.

Expected behavior

I don't expect to see the line with WARNING. I'm not sure whether I expect to see the line with handleCancellation; it's probably fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    VSCodebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions