WriteApi does not respect Ctrl+C / KeyboardInterrupt / SIGTERM
まだ誰も着手していません。
評価
調査の方向性
client.write_api() エントリーポイントと、influxdb_client/client/influxdb_client.py に示されている InfluxDBClient の使用方法から始めます。サーバーなしのケースを再現し、その後 Ctrl+C または SIGTERM 中の api.exit を追跡します。再試行が完了するまで待機するのではなく、シャットダウンによって速やかに KeyboardInterrupt が発生すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Specifications
- Client Version: 1.48.0
- InfluxDB Version: 2.4.0
- Platform: Ubuntu 24.04
Code sample to reproduce problem
- Make sure there is no server running at the address below.
- Run the following program
import urllib3
from influxdb_client.client.influxdb_client import InfluxDBClient
from influxdb_client.client.write.point import Point
_RETRIES = urllib3.util.Retry(total=6, backoff_factor=0.8)
p = Point("dsjfsfd")
with InfluxDBClient("http://127.0.0.1:8086", org="fake", retries=_RETRIES) as client:
with client.write_api() as api:
api.write("mybucket", client.org, p)
- Wait a second or two to make sure at least one attempt has been made.
- Press Ctrl+C (or send a
SIGTERMthrough some other mechanism, egkillutility on linux)
Expected behavior
api.__exit__ should raise a KeyboardInterrupt exception immediately.
Actual behavior
Program is stuck running for several minutes inside api.__exit__. Until program is force killed using SIGKILL or all retries have been exhausted.
Additional info
I've also experimented with write_options=WriteOptions(max_close_wait=1000) but it does not help and it has the risk to affect the normal flow when user is not pressing Ctrl+C
- 主要言語
- Python
- スター
- 792
- フォーク
- 186
- 平均マージ
- 3時間 2分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
influxdata/influxdb-client-python のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
influxdata/influxdb-client-python#613 · コメント 7 件 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
influxdata/influxdb-client-python#694 · リアクション 6 件 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 30/100
influxdata/influxdb-client-python#693 · コメント 2 件 · リアクション 1 件 ·
-
Socks proxy support オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
influxdata/influxdb-client-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
gradio-app/gradio#13895 ·
メンテナーはふだん 1 日以内に返信
-
build-error
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
spack/spack-packages#6713 ·
メンテナーはふだん 1 日以内に返信
-
Use issue templates オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ActivityWatch/activitywatch#1464 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: The ckg tool drops the return type of every decorated Python method in class search results オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
bytedance/trae-agent#483 ·
メンテナーはふだん 1 日以内に返信