Completion holds the read lock while it waits for `textDocument/completion`

Aperta
#2,018 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java

Direzione di ricerca

Start with LSPCompletionContributor.fillCompletionVariants, identified at line 81, and trace how its wait for textDocument/completion interacts with cancellation when a write action is waiting. The issue reports the freeze on 0.21.0 and says it has not been reproduced on 0.30.0; reproduce or investigate that behavior before choosing a fix. Done means a waiting completion no longer holds up the write action and other contributors' items remain available when the server is slow.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug completion not reproducible performance

The freeze Report 2101980159656853504 in #2014 (LSP4IJ 0.21.0, IntelliJ IDEA 262.8665.258, at startup, IDE killed after 40 s, probable cause LONG_READ_ACTION) is the completion thread waiting for textDocument/completion while it holds the read lock:

ProgressIndicatorUtils.awaitWithCheckCanceled(ProgressIndicatorUtils.java:374)
LSPCompletionContributor.fillCompletionVariants(LSPCompletionContributor.java:81)
CompletionService.getVariantsFromContributor(CompletionService.java:135)
...
CompletionProgressIndicator.calculateItems(CompletionProgressIndicator.java:1036)

The EDT was waiting for the write lock, but the completion's progress wasn't cancelled for 40 s, so awaitWithCheckCanceled kept waiting for the server.

In 0.30.0: unchanged. The wait is still at line 81; 2a5d0420 only made it null-safe. I haven't reproduced the freeze on 0.30.0 yet.

Possible fix: bound the wait and return no LSP items when the server takes longer, so that the completion still shows the items of the other contributors; or find out why a waiting write action doesn't cancel the completion's progress here.

Lingua principale
Java
Stelle
360
Fork
125
Merge medio
14h 13m
PR unite (30g)
189

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di redhat-developer/lsp4ij

Tutte le issue di redhat-developer/lsp4ij

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.