[BUG] ManagedRequestPipeline.close() leaves in-flight request futures pending forever
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- java
- Área
- backend, distributed-systems
Línea de trabajo
Start with base-rpc/base-rpc-client/src/main/java/org/apache/bifromq/baserpc/client/ManagedRequestPipeline.java and compare close() with onStreamError(), especially how preflightTaskQueue and inflightTaskQueue are cancelled. Verify that closing a pipeline completes both unsent and already-sent request futures, using the full client/server RPC stack or the in-process transport reproduction described in the issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Environment
- BiFroMQ
4.0.0/main @ eef5e3af - Module:
base-rpc/base-rpc-client - File:
base-rpc/base-rpc-client/src/main/java/org/apache/bifromq/baserpc/client/ManagedRequestPipeline.java(close())
Summary
close() cancels only preflightTaskQueue (requests not yet sent). It never touches inflightTaskQueue (sent, awaiting a response). After super.close() disposes the stream, responses can never arrive and onStreamError() — the only path that calls cancelInflightTasks() — will not fire again, so the futures of already-sent requests never complete. Callers on the direct (non-batched) query/execute path hang forever; the batched path is only saved by Batcher's orTimeout(maxBurstLatency) fallback.
Pipelines are replaced via old.close() on store→server route changes, so one range migration with a query in flight triggers this.
Suggested fix
Abort in-flight tasks on close, mirroring onStreamError:
if (isClosed.compareAndSet(false, true)) {
super.close();
meter.recordCount(RPCMetric.ReqPipelineCompleteCount);
cancelPreflightTasks(new RequestAbortException("Pipeline has closed"));
cancelInflightTasks(new RequestAbortException("Pipeline has closed"));
}
Verification note
A regression test requires a full RPC stack (client + server + stream disposal); we verified the path statically and in a rolling multi-node deployment (see below). A reproduction using the in-process transport can be provided if useful.
Production validation
A 6-node BifroMQ 4.0.0 cluster (standalone.sh, systemd, mTLS clientAuth=REQUIRE), fronted by a TCP load balancer with 6 backends. Live clients: 3 bridge replicas (MQTT5, $oshare subscribers) and 10 backend service instances (persistent sessions). RocksDB engine, default configuration otherwise.
The fix (plus other changes) was rolled across all six nodes one node at a time (wholesale lib/ replacement, then restart), with a per-node gate (service active, all four ports listening, cluster mesh re-established). Six of six nodes succeeded, zero rollbacks.
Post-deploy checks (all measured after the rollout):
| Check | Result |
|---|---|
| Cluster mesh (inter-node 8898/8899 connections, per node) | 408–417 established on every node |
| Live client connections (3 bridge replicas + 10 backend services over mTLS) | 13/13 reconnected and stable |
| Cross-node delivery end-to-end | publish on one node → bridge (connected elsewhere) consumed it → forwarded (counter 0 → 1) |
| Client-visible protocol smoke | connect / subscribe / publish with QoS 1 all CONNACK 0 / PUBACK 0 |
No non-batched caller hangs were observed in the rollout window; the fix removes the latent path.
- Lenguaje dominante
- Java
- Estrellas
- 806
- Forks
- 98
- Merge medio
- 12 h 35 min
- PR fusionados (30 d)
- 3
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/bifromq
-
[BUG] KVRangeRestorer leaves the restore future uncompleted when startRestore() throws, permanently wedging the rangePosiblemente ocupada @ImDanXie la tomó hace 37 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
[BUG] TopicUtil.isValidTopicFilter accepts "$share/g/" — a shared subscription with an empty filter that can never matchPosiblemente ocupada @efegokdemir la tomó hace 38 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
[BUG] UTF8Util.isWellFormed inverts the surrogate-pair check: valid non-BMP characters are rejected, lone surrogates acceptedPosiblemente ocupada @efegokdemir la tomó hace 38 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Inbound and outbound packet-size checks differ, so a QoS 1 message just under MaxUserPayloadBytes is accepted but never delivered (blocks a persistent subscriber)Quizá libre de nuevo @abhiramaab la tomó hace 30 días y no hay ningún pull request abierto. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Todos los issues de apache/bifromq
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
EpssMirrorTask leaks temp file on failed download and has no request timeoutPosiblemente ocupada @someshhh-45 la tomó hoy. Abiertodefect in triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
DependencyTrack/dependency-track#7845 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: WriteFileTool shows "Error reading file" snippet for relative paths when baseDir is setPosiblemente ocupada @ShryukGrandhi la tomó hoy. Abierto
Dificultad 2/5 Menos de una hora Aptitud para principiantes 86/100
agentscope-ai/agentscope-java#3917 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/maven-checkstyle-plugin#735 ·
Los mantenedores suelen responder en 1 día