SIGTERM kills db-sync mid-pull; proposal: finish the current connection and exit between cycles
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 52/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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).
- Vorherrschende Sprache
- Python
- Sterne
- 55
- Forks
- 25
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus MerginMaps/db-sync
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 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 connectionEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
MerginMaps/db-sync#195 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 38/100
MerginMaps/db-sync#185 · 1 Kommentar ·
-
db-sync enters an infinite drop/recreate loop when geodiff init fails on invalid source geometriesOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 42/100
MerginMaps/db-sync#182 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 52/100
MerginMaps/db-sync#181 · 2 Kommentare ·
Alle Issues in MerginMaps/db-sync
Ähnliche Issues
-
bug(mcp): handle malformed and partial reranker responses safelyEvtl. vergeben @KamilEjaz890 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
kubeflow/docs-agent#301 ·
Maintainer antworten meist innerhalb von 4 Tagen
-
Update the demo docsOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
pulp/pulp_workflow#78 ·
-
Bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
pgadmin-org/pgadmin4#10797 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
gcivil-nyu-org/team5-mon-fall26#132 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 76/100
gcivil-nyu-org/team4-mon-fall26#291 ·
Maintainer antworten meist innerhalb von 1 Tag