Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[CI] NettyClientTest.testServerDisconnection may fail with DisconnectException

クローズ 初心者向け
#4,693 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@yangshangqing95 がすでに取り組んでいます。

2026年10月17日 から。

  • #4694 @yangshangqing95 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
86/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java
領域
testing

調査の方向性

165行目の失敗するアサーション付近にある NettyClientTest.testServerDisconnection から始めます。リクエスト失敗後に接続マップが空になるまでテストがどのように待機するかを読み、その後、既存のクリーンアップ待機を維持しながら、nettyServer.close() の後、次のリクエストの前に待機を追加します。対象のテストを繰り返し実行し、常に ConnectException をアサートすることを確認します。

索引モデルが issue の本文から書いたものです。

説明

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!
主要言語
Java
スター
2.2k
フォーク
658
平均マージ
2日 23時間
マージ済み PR(30日)
103

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/fluss のほかの issue

apache/fluss の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。