ydb-platform / ydb-platform/ydb-java-sdk
Create a new session on closing of another can create deadlock
Open
Nobody has claimed this yet.
bug
high-priority
- Dominant language
- Java
- Stars
- 53
- Forks
- 40
- Avg merge
- 9h 51m
- Merged PRs (30d)
- 7
Description
"grpc-default-worker-ELG-1-1" #57 daemon prio=5 os_prio=0 cpu=25024.63ms elapsed=2828.70s tid=0x00007fc0e6a9d010 nid=0x533f waiting on condition [0x00007fc0e69f8000]
java.lang.Thread.State: TIMED_WAITING (parking)
at jdk.internal.misc.Unsafe.park(java.base@17.0.3-vanilla/Native Method)
- parking to wait for <0x00000000c36ea3d0> (a java.util.concurrent.CompletableFuture$Signaller)
at java.util.concurrent.locks.LockSupport.parkNanos(java.base@17.0.3-vanilla/LockSupport.java:252)
at java.util.concurrent.CompletableFuture$Signaller.block(java.base@17.0.3-vanilla/CompletableFuture.java:1866)
at java.util.concurrent.ForkJoinPool.unmanagedBlock(java.base@17.0.3-vanilla/ForkJoinPool.java:3463)
at java.util.concurrent.ForkJoinPool.managedBlock(java.base@17.0.3-vanilla/ForkJoinPool.java:3434)
at java.util.concurrent.CompletableFuture.timedGet(java.base@17.0.3-vanilla/CompletableFuture.java:1939)
at java.util.concurrent.CompletableFuture.get(java.base@17.0.3-vanilla/CompletableFuture.java:2095)
at tech.ydb.core.impl.pool.GrpcChannel$ReadyWatcher.getReadyChannel(GrpcChannel.java:80)
at tech.ydb.core.impl.pool.GrpcChannel.getReadyChannel(GrpcChannel.java:46)
at tech.ydb.core.impl.BaseGrpcTransport.unaryCall(BaseGrpcTransport.java:84)
at tech.ydb.table.rpc.grpc.GrpcTableRpc.createSession(GrpcTableRpc.java:50)
at tech.ydb.table.impl.BaseSession.createSessionId(BaseSession.java:174)
at tech.ydb.table.impl.pool.SessionPool$Handler.create(SessionPool.java:183)
at tech.ydb.table.impl.pool.WaitingQueue.tryToCreateNewPending(WaitingQueue.java:226)
at tech.ydb.table.impl.pool.WaitingQueue.checkNextWaitingAcquire(WaitingQueue.java:276)
at tech.ydb.table.impl.pool.WaitingQueue.lambda$checkNextWaitingAcquire$0(WaitingQueue.java:279)
at tech.ydb.table.impl.pool.WaitingQueue$$Lambda$2581/0x00000008013e9000.accept(Unknown Source)
at java.util.concurrent.CompletableFuture.uniWhenComplete(java.base@17.0.3-vanilla/CompletableFuture.java:863)
at java.util.concurrent.CompletableFuture.uniWhenCompleteStage(java.base@17.0.3-vanilla/CompletableFuture.java:887)
at java.util.concurrent.CompletableFuture.whenComplete(java.base@17.0.3-vanilla/CompletableFuture.java:2325)
at tech.ydb.table.impl.pool.WaitingQueue.checkNextWaitingAcquire(WaitingQueue.java:277)
at tech.ydb.table.impl.pool.WaitingQueue.lambda$checkNextWaitingAcquire$0(WaitingQueue.java:279)
at tech.ydb.table.impl.pool.WaitingQueue$$Lambda$2581/0x00000008013e9000.accept(Unknown Source)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing session creation and waiting behavior through tech.ydb.table.impl.pool.SessionPool, WaitingQueue, BaseSession, and tech.ydb.core.impl.pool.GrpcChannel, using the supplied stack trace as the entry point. Reproduce or isolate the case where creating a session while another closes causes a deadlock, then verify that session-pool operations complete without blocking each other.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100