Skip to content

Conversation

@kubukoz
Copy link
Contributor

@kubukoz kubukoz commented May 13, 2025

This happened in #207. I noticed it during the upgrade from 0.0.22 to 0.0.23, and had to bisect my endpoints to find the one causing trouble - it's textDocument/documentSymbol.

Not sure what happened yet, but you should be seeing this job time out...

@kubukoz
Copy link
Contributor Author

kubukoz commented May 13, 2025

stuck thread stack:

"io-compute-7@27960" tid=0x233 nid=NA waiting
  java.lang.Thread.State: WAITING
	  at jdk.internal.misc.Unsafe.park(Unsafe.java:-1)
	  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:221)
	  at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:754)
	  at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1099)
	  at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:230)
	  at langoustine.lsp.structures.DocumentSymbol$.reader$lzyINIT123(structures.scala:2601)
	  at langoustine.lsp.structures.DocumentSymbol$.reader(structures.scala:2601)
	  at langoustine.lsp.codecs.structures_DocumentSymbolCodec.visitors$lzyINIT123$1(codecs.scala:2409)
	  - locked <0x720e> (a scala.runtime.LazyRef)
	  at langoustine.lsp.codecs.structures_DocumentSymbolCodec.visitors$123(codecs.scala:151)
	  at langoustine.lsp.codecs.structures_DocumentSymbolCodec.reader(codecs.scala:2409)
	  at langoustine.lsp.codecs.structures_DocumentSymbolCodec.reader$(codecs.scala:2407)
	  at langoustine.lsp.structures.DocumentSymbol$.reader$lzyINIT123(structures.scala:2601)
	  at langoustine.lsp.structures.DocumentSymbol$.reader(structures.scala:2601)
	  at langoustine.lsp.codecs.requests_textDocument_documentSymbol.outputReader(codecs.scala:587)
	  at langoustine.lsp.codecs.requests_textDocument_documentSymbol.outputReader$(codecs.scala:556)
	  at langoustine.lsp.requests.textDocument$documentSymbol$.outputReader$lzyINIT22(requests.scala:570)
	  at langoustine.lsp.requests.textDocument$documentSymbol$.outputReader(requests.scala:570)
	  at langoustine.lsp.jsonrpcIntegration$.handlerToEndpoint(JSONRPC.scala:55)
	  at langoustine.lsp.ImmutableLSPBuilder.handleRequest(ImmutableLSPBuilder.scala:43)
	  at tests.core.LSPTests$.$init$$$anonfun$3(LSPTests.scala:116)
	  at tests.core.LSPTests$$$Lambda/0x0000007002b27980.apply(Unknown Source:-1)
	  at scala.util.Try$.apply(Try.scala:217)
	  at weaver.Test$.pure(Test.scala:31)
	  at weaver.FunSuiteF.test$$anonfun$1(suites.scala:187)
	  at weaver.FunSuiteF$$Lambda/0x0000007002b26ec0.apply(Unknown Source:-1)
	  at weaver.FunSuiteF.pureSpec$$anonfun$1(suites.scala:197)
	  at weaver.FunSuiteF$$Lambda/0x0000007002b438c8.apply(Unknown Source:-1)

@keynmol you naughty boy, did you play with lazy vals again

@kubukoz
Copy link
Contributor Author

kubukoz commented May 13, 2025

it's gotta be the fact that DocumentSymbol is recursive. I reverted the creation of MyCaseClassReader and it helped, it must've been that.

We're back to "New anonymous class definition will be duplicated at each inline site", but I bet the anon class does something to the initialization of the lazy val that makes it unstuck...

@kubukoz
Copy link
Contributor Author

kubukoz commented May 13, 2025

d'oh, it was just that the laziness of visitors was lost in the refactor - fixed. The other changes are just for style reasons

@kubukoz kubukoz changed the title Reproduce regression: registering a documentSymbol endpoint hangs the app Fix regression: DocumentSymbol codec deadlock May 13, 2025
@kubukoz kubukoz marked this pull request as ready for review May 13, 2025 23:59
Copy link
Contributor

@keynmol keynmol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, nice catch!

@keynmol keynmol merged commit 7993903 into neandertech:main May 14, 2025
2 checks passed
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 this pull request may close these issues.

2 participants