SIGTERM kills db-sync mid-pull; proposal: finish the current connection and exit between cycles
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 52/100
调研方向
Start by reading dbsync_daemon.py and tracing dbsync_pull(), dbsync_push(), and run_daemon() to understand the cycle boundaries described in the issue. Implement the proposed SIGTERM shutdown behavior, then verify that a started pull or push can finish before the process exits and that SIGINT retains its default behavior.
由索引模型根据 Issue 内容生成。
描述
dbsync_daemon.py installs no SIGTERM handler, so a docker stop,
docker compose up -d after a rebuild, or a service manager restart ends
the process wherever it happens to be. If that is inside pull() between
"GeoPackage updated" (the checkout is at the new version) and "base
schema updated" (the changeset has been applied to the database), the
checkout and the base schema are at the same version with different
content, and the next start refuses with
The db schemas already exist but 'base' schema is not synchronized with source GPKG. Running `dbsync_deamon.py` with `--force-init` should fix the issue.
--force-init then drops and rebuilds the schemas, which loses any
not-yet-pushed database edits and any views or grants on the schemas.
We hit this in production with four projects and a routine image
rebuild (one daemon was pulling 48 files at that moment).
Proposal, implemented in the PR that follows: a SIGTERM handler that only
sets a flag; dbsync_pull()/dbsync_push() check it before each
connection; run_daemon() checks it at the top of the cycle and between
pull and push; the sleep polls it once a second. A pull or push that has
started always completes; the process exits 0 at the next boundary.
SIGINT keeps its default so ctrl+c still kills immediately. A container
needs stop_grace_period long enough for one connection's pull
(we use 150 s).
- 主要语言
- Python
- 星标
- 55
- 派生
- 25
- 平均合并
- 3 天 22 小时
- 30 天内合并 PR
- 1
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MerginMaps/db-sync 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
MerginMaps/db-sync#184 ·
-
Rebase: a field update of a row deleted in the database is dropped without any record; and the conflicts file is per project, not per connection可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 48/100
MerginMaps/db-sync#195 ·
-
难度 3/5 1-2 天 新手友好度 38/100
MerginMaps/db-sync#185 · 1 条评论 ·
-
db-sync enters an infinite drop/recreate loop when geodiff init fails on invalid source geometries未关闭
难度 4/5 3-5 天 新手友好度 42/100
MerginMaps/db-sync#182 ·
-
难度 3/5 1-2 天 新手友好度 52/100
MerginMaps/db-sync#181 · 2 条评论 ·
查看 MerginMaps/db-sync 的全部 Issue
相似的 Issue
-
Bug
难度 2/5 1-3 小时 新手友好度 62/100
pgadmin-org/pgadmin4#10797 ·
维护者通常 2 天内回复
-
good first issue
难度 1/5 1 小时以内 新手友好度 72/100
ida-arbeitszeit/workers-control#1588 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
aws-samples/sample-per-model-bedrock#930 ·
维护者通常 1 天内回复
-
Locus / Transcript lacks __bool__, so bool(transcript) queries the SQLite exon table via __len__未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
Deltares/numba_celltree#100 · 1 条评论 ·