Idle connection thread is not a daemon, so the JVM cannot exit without close()
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- java
- 領域
- networking
調査の方向性
httpclient/src/main/java/com/backblaze/b2/client/webApiHttpClient/HttpClientFactoryImpl.java から始めてください。60〜61行目のコンストラクタがアイドル接続を監視するスレッドを作成して開始しており、220〜246行目のスレッドクラスでは setDaemon が一度も呼ばれていません。デフォルトのファクトリで B2StorageClient を作成し、close() を呼ばずに戻る小さな main を実行して再現させ、JVM が終了し続けるかどうかを確認してください。JVM が自力で終了し、start() の前にスレッドをデーモンとして設定した後も既存のテストが通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
What happens
HttpClientFactoryImpl starts an IdleConnectionMonitorThread in its constructor, and the thread is never marked as a daemon. A program that creates a client and does not call close() on it keeps running after main returns, with no message. Calling close() is documented as the right way, but the hang is easy to hit in short programs and tests.
Where
httpclient/src/main/java/com/backblaze/b2/client/webApiHttpClient/HttpClientFactoryImpl.java:60-61 (constructor creates and starts the thread) and :220-246 (the thread class, which does not call setDaemon(true); no setDaemon call exists anywhere in the repository).
Why it matters
Impact: Left behind (a running thread keeps the process alive), silent. Severity: Medium, because it only happens when the caller never closes the client (an unusual condition, since B2StorageClientImpl documents that close() should be called) and the workaround is to call close().
How to check
Found by reading the code, not reproduced. Read the constructor and the thread class. Running a small main that builds a B2StorageClient with the default factory and returns without closing it should leave the JVM running (a thread dump would show the monitor thread). Calling setDaemon(true) before start() would let the JVM exit.
Version
Seen at v6.5.0. Present on the default branch: present.
- 主要言語
- Java
- スター
- 103
- フォーク
- 23
- 平均マージ
- 5日 8時間
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Backblaze/b2-sdk-java のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Backblaze/b2-sdk-java#248 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
Backblaze/b2-sdk-java#247 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Backblaze/b2-sdk-java#246 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Backblaze/b2-sdk-java#245 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Backblaze/b2-sdk-java#242 ·
メンテナーはふだん 3 日以内に返信
Backblaze/b2-sdk-java の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
IETF-Hackathon/pqc-certificates#351 ·
メンテナーはふだん 2 日以内に返信
-
bug(core): skip_nodes.json is missing SELECT and PRE, causing Python and Java to insert separators into dropdown options and preformatted text対応中かも @Bhumit267 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
ExceptionThrowShouldUseContext: NullPointerException on a catch block inside an annotation type対応中かも @Carbon14-48 が今日担当しました。 オープンapproved
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
checkstyle/checkstyle#22784 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信