Ctrl-C-ing borgmatic doesn't terminate Borg #1015
Labels
No labels
blocked
breaking
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
borgmatic-collective/borgmatic#1015
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
As per https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1095980, pressing ctrl-C while borgmatic is running Borg does not terminate Borg. This seems like a regression, in that I'm pretty sure older versions of borgmatic used to terminate Borg. It's also possible although less likely that this is a Borg regression rather than anything wrong with borgmatic.
I reproduced this behavior on both borgmatic 1.9.3 and borgmatic main.
Steps to reproduce
source_directoriesso that the borgmatic run isn't too fast to ctrl-C.borgmatic -c test.yaml create -v 2 --list(similar behavior forcheck)Actual behavior
Expected behavior
Borg isn't running.
Other notes / implementation ideas
No response
borgmatic version
1.9.3 and main
borgmatic installation method
pipx install --editable
Borg version
1.4.0
Python version
3.13.1
Database version (if applicable)
No response
Operating system and version
No response
This has been "fixed" in main by sending SIGINT followed by a SIGTERM to Borg whenever borgmatic receives a SIGINT (ctrl-C). The delta from prior versions is the addition of the SIGTERM. I made this change because I determined via strace that borgmatic was forwarding SIGINT to Borg correctly, but in some cases Borg is ignoring it or just not taking action right away. I considered that maybe it'd be best to leave that decision to Borg, but then again it makes for a pretty poor user experience if a background Borg process just continues chewing CPU (and leaving a repository lock in place) after the user pretty clearly expressed their interest in interrupting both borgmatic and Borg. So I decided to give Borg a little extra encouragement in the form of a bonus SIGTERM.
Note that this change applies across the board to all child processes (database clients, filesystem snapshot executables, etc.).. Not just Borg.
This will be part of the next release.
Released in borgmatic 1.9.13!