SIGTERM kills db-sync mid-pull; proposal: finish the current connection and exit between cycles
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 52/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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).
- Langage dominant
- Python
- Étoiles
- 55
- Forks
- 25
- Merge moyen
- 3 j 22 h
- PR mergées (30 j)
- 1
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de MerginMaps/db-sync
-
Difficulté 2/5 1-3 heures Accessibilité débutants 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 connectionPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
MerginMaps/db-sync#195 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 38/100
MerginMaps/db-sync#185 · 1 commentaire ·
-
db-sync enters an infinite drop/recreate loop when geodiff init fails on invalid source geometriesOuverte
Difficulté 4/5 3-5 jours Accessibilité débutants 42/100
MerginMaps/db-sync#182 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 52/100
MerginMaps/db-sync#181 · 2 commentaires ·
Toutes les issues de MerginMaps/db-sync
Issues similaires
-
bug(mcp): handle malformed and partial reranker responses safelyPeut-être pris @KamilEjaz890 l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
kubeflow/docs-agent#301 ·
Les mainteneurs répondent en général sous 4 jours
-
Update the demo docsOuverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
pulp/pulp_workflow#78 ·
-
Invalid syntax in sshtunnelOuverteBug
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
pgadmin-org/pgadmin4#10797 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
gcivil-nyu-org/team5-mon-fall26#132 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 76/100
gcivil-nyu-org/team4-mon-fall26#291 ·
Les mainteneurs répondent en général sous 1 jour