SIGTERM kills db-sync mid-pull; proposal: finish the current connection and exit between cycles
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 52/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- Python
- Star
- 55
- Fork
- 25
- Merge trung bình
- 3 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MerginMaps/db-sync
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 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 connectionCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
MerginMaps/db-sync#195 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
MerginMaps/db-sync#185 · 1 bình luận ·
-
db-sync enters an infinite drop/recreate loop when geodiff init fails on invalid source geometriesĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
MerginMaps/db-sync#182 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
MerginMaps/db-sync#181 · 2 bình luận ·
Tất cả issue của MerginMaps/db-sync
Issue tương tự
-
Invalid syntax in sshtunnelĐang mởBug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
pgadmin-org/pgadmin4#10797 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
ida-arbeitszeit/workers-control#1588 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
aws-samples/sample-per-model-bedrock#930 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Locus / Transcript lacks __bool__, so bool(transcript) queries the SQLite exon table via __len__Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Deltares/numba_celltree#100 · 1 bình luận ·