Occasional leak of Thread/Channel instances and threads blocking indefinately
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
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- java, rabbitmq
- Ambito
- networking
Direzione di ricerca
Inizia da AMQChannel.doEnqueueRpc e segui il comportamento di attesa e timeout attraverso enqueueAsyncRpc, quiescingAsyncRpc, asyncRpc e privateAsyncRpc. Poi esamina ChannelN.asyncCompletableRpc e il percorso di dichiarazione di reactor Sender. Il lavoro è completato quando le invocazioni rispettano il timeout RPC invece di attendere indefinitamente, con una copertura per lo stato bloccato segnalato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
We noticed that occasionally we have threads stuck forever with the sack that point to the RabbitMQ channel class.
The stack is below. Generally there are several notes about this:
-
The the RPC timeout is not applied to the enqueueAsyncRpc part of the processing only to the IO part
This makes it possible for the thread to wait forever for _activeRpc to clear which in this case never happens.
i.e. the code below can loop forever disregarding the rpc timeout.while(this._activeRpc != null) { try { this._channelLockCondition.await(); } catch (InterruptedException var7) { var2 = true; } }I guess the same rpc timeout note goes for any "lock" calls
this._channelLock.lock()
A thread can also get stuck there forever. -
The code was recently refactored to use locks instead of the synchronized sections
It's not clear how that should work in the multi-threaded environment (java memory model) with members like _activeRpc.
They are not declared as volatile/atomic. How would memory barrier be enforced for multi-threaded access to the
member? -
Also the semantic of the at ChannelN.asyncCompletableRpc is async, so it should never block,
but in fact it can and does block.
========================== Threads get stuck in this state indefinitely ================
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park([email protected]/Native Method)
- parking to wait for <0x00000007a5c699d0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park([email protected]/LockSupport.java:341)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block([email protected]/AbstractQueuedSynchronizer.java:506)
at java.util.concurrent.ForkJoinPool.unmanagedBlock([email protected]/ForkJoinPool.java:3465)
at java.util.concurrent.ForkJoinPool.managedBlock([email protected]/ForkJoinPool.java:3436)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await([email protected]/AbstractQueuedSynchronizer.java:1623)
at com.rabbitmq.client.impl.AMQChannel.doEnqueueRpc
at com.rabbitmq.client.impl.AMQChannel.enqueueAsyncRpc
at com.rabbitmq.client.impl.AMQChannel.quiescingAsyncRpc
at com.rabbitmq.client.impl.AMQChannel.asyncRpc
at com.rabbitmq.client.impl.AMQChannel.privateAsyncRpc
at com.rabbitmq.client.impl.AMQChannel.exnWrappingAsyncRpc
at com.rabbitmq.client.impl.ChannelN.asyncCompletableRpc
at reactor.rabbitmq.Sender.lambda$declareExchange$16
...
Reproduction steps
It's not clear what is triggering the condition.
Expected behavior
Any invocation should respect the rpc timeout.
Additional context
The code is using 5.20.0 version of the java client.
- Lingua principale
- Java
- Stelle
- 1.3k
- Fork
- 588
- Merge medio
- 4h 40m
- PR unite (30g)
- 38
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rabbitmq/rabbitmq-java-client
-
Bump dependenciesApertadependency-upgrade
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
rabbitmq/rabbitmq-java-client#2110 ·
I maintainer di solito rispondono entro 1 giorno
-
Add option to automatically set User-ID in basicPublishForse di nuovo libera @UmerQureshi21 l’ha presa 284 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
rabbitmq/rabbitmq-java-client#1748 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
rabbitmq/rabbitmq-java-client#1535 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
rabbitmq/rabbitmq-java-client#1421 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Thread Pinning occurs with VirtualThreads enabled (spring boot 3)Forse di nuovo libera @acogoluegnes l’ha presa 952 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement help-wanted
rabbitmq/rabbitmq-java-client#1276 · 3 commenti · 2 assegnatari ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di rabbitmq/rabbitmq-java-client
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug/错误
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
FCL-Team/FoldCraftLauncher#1982 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] micronaut-serde-oracle-jdbc-json brings a second OJDBC driver onto the runtime classpathForse già presa @ZARAYACH l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
micronaut-projects/micronaut-serialization#1494 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 75/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
I maintainer di solito rispondono entro 2 giorni