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時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 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 件 ·