WriteApi does not respect Ctrl+C / KeyboardInterrupt / SIGTERM
还没有人认领这个 Issue。
评估
调研方向
从 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
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 个 reaction ·
-
bug
难度 3/5 1-2 天 新手友好度 30/100
influxdata/influxdb-client-python#693 · 2 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 35/100
查看 influxdata/influxdb-client-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
conda-forge/conda-build-feedstock#289 · 1 条评论 · 1 个 reaction ·
-
`pulptest` no longer works in 4.0.0: `ImportError: Start directory is not importable: 'pulp/tests'`未关闭
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 72/100
TomCasavant/ohio-sites#224 ·