Skip to content

NxGraphServer uses 64 threads causing Rider to freeze #2385

Open
@ilnarag

Description

@ilnarag

We received a performance issue report in Rider, where the user claims that the IDE freezes sporadically.
According to the thread dumps, around 64 threads are blocked while performing the same task (NxGraphServer$handleGraphRequest).
Our Dispatchers.IO implementation uses a soft-limited parallelism model, where only 64 coroutines are allowed to run simultaneously by default.
Since approximately 64 threads in the dispatcher are blocked, no additional coroutines can run, resulting in a freeze.

Failure Logs / Images / Videos

"DefaultDispatcher-worker-10" prio=0 tid=0x0 nid=0x0 waiting on condition
     java.lang.Thread.State: WAITING
 on java.util.concurrent.CompletableFuture$Signaller@12c4327d
	at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
	at [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:221)
	at [email protected]/java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1864)
	at [email protected]/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:4013)
	at [email protected]/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3961)
	at [email protected]/java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1898)
	at [email protected]/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2072)
	at platform/[email protected]/jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:931)
	at platform/[email protected]/jdk.internal.net.http.HttpClientFacade.send(HttpClientFacade.java:133)
	at NxGraphServer$handleGraphRequest$response$1.invokeSuspend(NxGraphServer.kt:104)
	at NxGraphServer$handleGraphRequest$response$1.invoke(NxGraphServer.kt)
	at NxGraphServer$handleGraphRequest$response$1.invoke(NxGraphServer.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
	at NxGraphServer.handleGraphRequest(NxGraphServer.kt:96)
	at NxGraphServer.handleGraphRequest$default(NxGraphServer.kt:74)
	at dev.nx.console.graph.NxGraphBrowserBase$createGraphRequestMessenger$1$1$response$1.invokeSuspend(NxGraphBrowserBase.kt:423)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.internal.SoftLimitedDispatcher$Worker.run(SoftLimitedDispatcher.kt:125)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)

Environment

  • Nx Console version: 1.35.1
  • Rider version: 2024.3.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions