SIGTERM kills db-sync mid-pull; proposal: finish the current connection and exit between cycles
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 52/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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).
- Lingua principale
- Python
- Stelle
- 55
- Fork
- 25
- Merge medio
- 3g 22h
- PR unite (30g)
- 1
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di MerginMaps/db-sync
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 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 connectionForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
MerginMaps/db-sync#195 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
MerginMaps/db-sync#185 · 1 commento ·
-
db-sync enters an infinite drop/recreate loop when geodiff init fails on invalid source geometriesAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
MerginMaps/db-sync#182 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
MerginMaps/db-sync#181 · 2 commenti ·
Tutte le issue di MerginMaps/db-sync
Issue simili
-
Invalid syntax in sshtunnelApertaBug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
pgadmin-org/pgadmin4#10797 ·
I maintainer di solito rispondono entro 2 giorni
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
ida-arbeitszeit/workers-control#1588 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
aws-samples/sample-per-model-bedrock#930 ·
I maintainer di solito rispondono entro 1 giorno
-
Locus / Transcript lacks __bool__, so bool(transcript) queries the SQLite exon table via __len__Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Deltares/numba_celltree#100 · 1 commento ·