Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[CI] NettyClientTest.testServerDisconnection may fail with DisconnectException

Chiusa Adatta ai principianti
#4,693 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@yangshangqing95 ci sta già lavorando.

Dal 17/10/2026.

  • #4694 di @yangshangqing95 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
86/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java
Ambito
testing

Direzione di ricerca

Inizia da NettyClientTest.testServerDisconnection, vicino all’asserzione che fallisce alla riga 165. Leggi come il test attende che la mappa delle connessioni diventi vuota dopo il fallimento della richiesta, quindi aggiungi un’attesa dopo nettyServer.close() e prima della richiesta successiva, mantenendo l’attesa di pulizia esistente. Esegui ripetutamente il test mirato; dovrebbe verificare in modo coerente ConnectException.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Search before asking
  • I searched in the issues and found nothing similar.
Fluss version

1.0.0 (latest release)

Please describe the bug 🐞

NettyClientTest.testServerDisconnection can still fail intermittently in CI after #4344.

The test expects a ConnectException when sending a request after shutting down the Netty server, but occasionally receives a DisconnectException instead:

NettyClientTest.testServerDisconnection:165

Expecting actual throwable to be an instance of:
  java.net.ConnectException
but was:
  org.apache.fluss.exception.DisconnectException:
  Cannot send request to server localhost:40463
  (id: cs-1, rack: null) because it is disconnected.

https://github.com/apache/fluss/actions/runs/39053988878/job/117458107688?pr=4545

After nettyServer.close(), the client detects the disconnection and asynchronously removes the old ServerConnection from its connection map.

However, the test immediately sends another request without waiting for the old connection to be removed.

If the request arrives after the connection has entered the DISCONNECTED state but before it is removed from the map, NettyClient.getOrCreateConnection() may return the disconnected connection.

In this case, ServerConnection.doSend() fails the request with a DisconnectException rather than attempting a new connection that would fail with a ConnectException.

This makes the exception assertion sensitive to the timing of asynchronous connection cleanup.

The previous fix in #4344 added a retry to wait for the connection map to become empty, but that retry happens after the failed request and therefore does not prevent this race.

Solution

Wait for the old connection to be removed after shutting down the server and before sending the next request.

Keep the existing retry after the failed request to ensure that the newly created, failed connection is also cleaned up before restarting the server.

This preserves the existing ConnectException assertion and requires no changes to production code.

Are you willing to submit a PR?
  • I'm willing to submit a PR!
Lingua principale
Java
Stelle
2.2k
Fork
656
Merge medio
2g 16h
PR unite (30g)
103

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/fluss

Tutte le issue di apache/fluss

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.