Skip to content

Cancelling a request may result in a stale progress indicator #981

Closed
@robertoaloi

Description

When a request is cancelled by the client, a background job maybe killed. As a consequence, a progress report may become stale on the client (e.g. showing a 0 / 1 or similar in the status bar), since an end message was never sent from the server to the client.

Original discussion:

Jesper Eskilson Today at 10:53 AM
erlang_ls seems to be leaving a bunch of "stale" 0/1 progress indicators in the Emacs modeline. I tried to reproduce this, but of course when I tried to provoke it, it didn't happen. See screenshot: (edited) 

roberto.aloi  8 minutes ago
Interesting. I just checked my LSP logs to see what could be.

roberto.aloi  7 minutes ago
cat /tmp/logs | grep -A3 '"kind": "begin"' | grep token > /tmp/begin
cat /tmp/logs | grep -A2 '"kind": "end"' | grep token > /tmp/end
cat /tmp/begin | sort > /tmp/begin-sorted
cat /tmp/token-end | sort > /tmp/end-sorted
diff /tmp/begin-sorted /tmp/end-sorted

roberto.aloi  6 minutes ago
This shows two tasks which start, but do not end

roberto.aloi  4 minutes ago
What I think happens is that, upon cancellation, the background job gets killed. But the final "report" message is not sent to the client.

roberto.aloi  3 minutes ago
I assumed the client would clear those for cancelled requests, but of course the reports are originated by the server, so Erlang LS should take care of the mapping and cleaning. Well spotted!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions