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

OCaml-LSP hangs for some on-hover queries in Irmin's codebase #1192

Closed
voodoos opened this issue Sep 26, 2023 · 1 comment · Fixed by ocaml/opam-repository#24528
Closed
Milestone

Comments

@voodoos
Copy link
Collaborator

voodoos commented Sep 26, 2023

In Irmin, hovering at position 43:40 in file irmin_pack_mem.ml causes ocaml-lsp to hang at 100% cpu.
Cancellation is not working and the process must be manually killed.

Merlin does answer fast (with index 0, see #1191):

❯ ocamlmerlin single type-enclosing -position 43:40 -index 0 \
      -filename src/irmin-pack/mem/irmin_pack_mem.ml <src/irmin-pack/mem/irmin_pack_mem.ml | jq '.timing'
{
  "clock": 263,
  "cpu": 207,
  "query": 40,
  "pp": 0,
  "reader": 1,
  "ppx": 23,
  "typer": 144,
  "error": 0
}
@voodoos
Copy link
Collaborator Author

voodoos commented Sep 26, 2023

It looks like it is actually the document query (that ocaml-lsp runs along type-enclosing with each type-on-hover request) that hangs.

Running merlin directly also hangs:

❯ ocamlmerlin single document -position 43:40 -filename src/irmin-pack/mem/irmin_pack_mem.ml <src/irmin-pack/mem/irmin_pack_mem.ml | jq '.timing'

voodoos added a commit to ocaml/merlin that referenced this issue Sep 26, 2023
voodoos added a commit to voodoos/merlin that referenced this issue Sep 26, 2023
voodoos added a commit to voodoos/merlin that referenced this issue Sep 26, 2023
voodoos added a commit to ocaml/merlin that referenced this issue Sep 26, 2023
voodoos added a commit to ocaml/merlin that referenced this issue Sep 26, 2023
voodoos added a commit to voodoos/opam-repository that referenced this issue Sep 26, 2023
CHANGES:

Tue Sep 26 17:45:42 CEST 2023

  + merlin binary
    - Fix issue with let operators and tuples (ocaml/merlin#1684, fixes ocaml/merlin#1683, fixes
      ocaml/ocaml-lsp#1182)
    - Fix an issue causing Merlin locate queries to hang (ocaml/merlin#1686,
      fixes ocaml/ocaml-lsp#1192)
voodoos added a commit to voodoos/opam-repository that referenced this issue Sep 26, 2023
CHANGES:

Tue Sep 26 17:45:42 CEST 2023

  + merlin binary
    - Fix issue with let operators and tuples (ocaml/merlin#1684, fixes ocaml/merlin#1683, fixes
      ocaml/ocaml-lsp#1182)
    - Fix an issue causing Merlin locate queries to hang (ocaml/merlin#1686,
      fixes ocaml/ocaml-lsp#1192)
voodoos added a commit to voodoos/opam-repository that referenced this issue Sep 26, 2023
CHANGES:

Tue Sep 26 17:45:42 CEST 2023

  + merlin binary
    - Fix issue with let operators and tuples (ocaml/merlin#1684, fixes ocaml/merlin#1683, fixes
      ocaml/ocaml-lsp#1182)
    - Fix an issue causing Merlin locate queries to hang (ocaml/merlin#1686,
      fixes ocaml/ocaml-lsp#1192)
voodoos added a commit to voodoos/opam-repository that referenced this issue Sep 26, 2023
CHANGES:

Tue Sep 26 17:45:42 CEST 2023

  + merlin binary
    - Fix issue with let operators and tuples (ocaml/merlin#1684, fixes ocaml/merlin#1683, fixes
      ocaml/ocaml-lsp#1182)
    - Fix an issue causing Merlin locate queries to hang (ocaml/merlin#1686,
      fixes ocaml/ocaml-lsp#1192)
@rgrinberg rgrinberg added this to the 1.17.0 milestone Sep 26, 2023
nberth pushed a commit to nberth/opam-repository that referenced this issue Jun 18, 2024
CHANGES:

Tue Sep 26 17:45:42 CEST 2023

  + merlin binary
    - Fix issue with let operators and tuples (ocaml/merlin#1684, fixes ocaml/merlin#1683, fixes
      ocaml/ocaml-lsp#1182)
    - Fix an issue causing Merlin locate queries to hang (ocaml/merlin#1686,
      fixes ocaml/ocaml-lsp#1192)
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.

2 participants