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

LSP request cancellation seems to be causing server crashes with v0.57.0 #1009

Closed
razzmatazz opened this issue Sep 5, 2022 · 9 comments · May be fixed by ionide/LanguageServerProtocol#35
Closed

Comments

@razzmatazz
Copy link
Contributor

razzmatazz commented Sep 5, 2022

Started happening with v0.57.0

The cause seems to be cancelation requests ($/cancelRequest) from LSP client. This basically makes v0.57.0 unusable on emacs as emacs/lsp-mode actively cancels requests when things come out of view and results are not needed anymore or UI actions are cancelled by user directly.

I have this on my LSP trace log:

[Trace - 08:59:17 PM] Sending request 'textDocument/codeAction - (155)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/bob/src/csharp-language-server/src/CSharpLanguageServer/Server.fs"
  },
  "range": {
    "start": {
      "line": 312,
      "character": 19
    },
    "end": {
      "line": 312,
      "character": 19
    }
  },
  "context": {
    "diagnostics": [
      {
        "range": {
          "start": {
            "line": 312,
            "character": 20
          },
          "end": {
            "line": 314,
            "character": 16
          }
        },
        "severity": 1,
        "code": "10",
        "codeDescription": {
          "href": "https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/compiler-messages/fs0010"
        },
        "source": "F# Compiler",
        "message": "Incomplete structured construct at or before this point in expression",
        "relatedInformation": []
      }
    ]
  }
}


[Trace - 08:59:17 PM] Received response 'nil - (153)' in 0ms.
Result: {
  "code": -32800,
  "message": "The task was cancelled."
}


[Trace - 08:59:17 PM] Sending notification '$/cancelRequest'.
Params: {
  "id": 155
}

(*CRASH*)
@razzmatazz razzmatazz changed the title LSP request cancellation seems to be causing server crashes LSP request cancellation seems to be causing server crashes with v0.57.0 Sep 5, 2022
@razzmatazz
Copy link
Contributor Author

razzmatazz commented Sep 5, 2022

I think this could be related to:

..where Ionide.LSP will now crash server on unhandled/unknown exception (TaskCanceledException?) in order to avoid accidentally serializing exception object as a response as per Ionide.LSP#29.

CC @baronfel

@baronfel
Copy link
Contributor

baronfel commented Sep 5, 2022

Is this as potentially-simple to fix as adding TaskCanceledException to the set of 'known exceptions' in the IsFatalException check in Ionide.LSP?

@baronfel
Copy link
Contributor

baronfel commented Sep 5, 2022

Super weird that this doesn't seem to impact ionide - I've pointed my local ionide at the 0.57.0 FSAC dll and had no change.

@deapsquatter
Copy link

Just here to confirm I have the same crash with Emacs with v0.57 as @razzmatazz

@razzmatazz
Copy link
Contributor Author

not sure if related, but I see that FSAC has downgraded Ionide.LSP to 0.4.4 on this release

@baronfel
Copy link
Contributor

baronfel commented Sep 6, 2022

Oh geez, that's probably it then - lost the LSP upgrade on the churn of getting the proj-info dependency updated.

@baronfel
Copy link
Contributor

baronfel commented Sep 6, 2022

@razzmatazz wait, I see 0.4.7 of Ionide.LSP in the latest FSAC:

paket.lock:100: Ionide.LanguageServerProtocol (0.4.7)

@razzmatazz
Copy link
Contributor Author

@razzmatazz wait, I see 0.4.7 of Ionide.LSP in the latest FSAC:

paket.lock100 Ionide.LanguageServerProtocol (0.4.7)

oh right.. sorry, I noticed this commit a8d1172 but not the upgrade one later, sorry

so this is as problem w/ current/master Ionide.LSP

@razzmatazz
Copy link
Contributor Author

looks good now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants