-
Notifications
You must be signed in to change notification settings - Fork 119
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
[nvim] all RPC requests appear to be cancelled #1194
Comments
Update: I didn't realize when I made this issue that version constraints in my local switch forced me to use |
Can confirm that this issue is still present on |
Thanks for you report @zbaylin Is your project public ? Is there any way for us to reproduce the issue ? |
Unfortunately not, let me see if I can make a repro repo. |
@voodoos unfortunately I wasn't able to come up with an easily reproducible example. However, I did maybe get some more information? I attached
Continuing the process immediately hits the same breakpoint. Here's the backtrace from lldb:
(Sorry for the spam, but I hope that helps) It's unclear to me whether this is a bug in merlin or ocaml-lsp from the above, but it does seem like a deadlock is happening somewhere |
I am wondering whether this could be linked to the OS update. Could you try to reproduce on a freshly built switch ? |
I did build a brand new switch after first encountering this issue but sadly it's still present |
@voodoos I was able to somewhat fix this (I think) by removing this line:
which does square with @gasche's suggestion in the above linked PR that this might be an issue with the spawn library. Is there a reason the merlin version is replaced by a custom implementation? I would imagine |
Interesting, so it might be an issue with the Spawn library, or the way we use it. Still you didn't notice anything wrong before the OS update ? The hang happens when running ppxes. Could you check that this isn't specific to the ppx your using ? Also @rgrinberg may have more hindsight here ? |
To summarize my reasoning on the upstream issue ocaml/ocaml#12636 :
(Note: the issue may be fixed in OCaml 5 (rather than OCaml 4.14), because the implementation of threads is different and may interact better with forking in this case.) |
Thanks @gasche for the summary! In the linked PR it seems Xavier Leroy (avoiding tagging) has confirmed that this is a bug in the 4.14 runtime
Having not used
I looked into adding a shim |
Coincidentally, looking at the dune 3.11 release notes, it looks like @rgrinberg patched dune's vendored version of |
Regarding an ocaml-lsp workaround: I think that it would be easier to look at the usage context for |
(But yes it would be even easier to reuse other people's work to fix similar issues. It seems unfortunate that dune's improvement to the |
Unfortunately it looks like there are numerous uses of
That's why I thought it would be a good idea to stub out a compatibility module for If I understand correctly, |
I created a branch (https://github.com/skolemlabs/ocaml-lsp/tree/use-dune-vendored-spawn) that uses the vendored version of
seems to fix the issue for now. |
It's great to have a workaround, thanks @zbaylin ! It might be worth it to release a version of ocaml-lsp with that workaround since the issue probably impact all users that upgrade to Sonoma ? I am still somewhat surprised that we don't have more report of this issue, I will upgrade to Sonoma and try to reproduce. Do you have an Intel of M1/2 mac ? |
Just finished the upgrade, I wasn't able to reproduce so far. |
I also have a 14-inch 2021. I upgraded yesterday to Sonoma, and have no issue so far with ocaml-lsp 🤔. |
This fixed it for me as well. |
@frejsoya is the project your're working on open source ? Is there a way for us to reproduce ? |
No unfortunately not right know, i'll share something if it happens again. I hoped having one more hint at os x + Sonoma would help. Sorry for the "me too" :). I'm still on @zbaylin changes. I'll see if i can get a stack trace using the current release during the week. That is if i can reproduce :) |
@frejsoya, @zbaylin, PR ocaml/ocaml#12646 backports some 5.0 changes to 4.14 that may solve the issue. Would you try using this branch of OCaml and see if you are still able to reproduce ? |
:LspInfo
:Yesterday (after upgrading to macOS 14), the LSP appeared to repeatedly freeze after some small period of time editing. Looking at the LSP logs from Neovim, it appears that every LSP request is responded to with a JSON RPC cancellation (-32800).
I saw #1182, but pinning merlin-lib doesn't seem to fix this issue unfortunately.
The logs above don't seem to provide a ton of information, so let me know if there's somewhere else I can look for more verbose logs.
The text was updated successfully, but these errors were encountered: