SIGTERM is not terminating borgmatic #516
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#516
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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
I am using borgmatic on debian/testing. There borgmatic is started by a systemd timer and service. Stopping or restarting the service while borgmatic is creating an archive doesn't work.
Steps to reproduce (if a bug)
(it looks like it can also be 1 configuration file with multiple repositories)
/usr/bin/borgmatic --verbosity 1
pkill --signal TERM borgmatic
.Actual behavior (if a bug)
The work on the first repository is stopped, but borgmatic continues on the next repository.
Expected behavior (if a bug)
borgmatic should stop the current running action (of borg) and then terminate.
Other notes / implementation ideas
The signal SIGTERM indicates for a process that it needs to be stopped. The process is allowed to clean up it's environment (release locks) but then should stop as soon as possible. It should not start new long lasting actions.
It looks like the method
_handle_signal
only propagates the SIGTERM to the subprocesses, but the current process (borgmatic) can just continue (with the next repository). This is not correct. Borgmatic should stop as well.Environment
borgmatic version: [1.5.20]
borgmatic installation method: [Debian package]
Borg version: [borg 1.2.0]
Python version: [Python 3.9.12]
Database version (if applicable): [N/A]
operating system and version: [debian testing]
Good catch! Looks like it's indeed a bug based on the code, although I haven't yet verified with a local repro. Thank you for filing this.
EDIT: Got a local repro now.
This has been fixed in master! It'll be part of the next release. Thanks again.
Released in borgmatic 1.6.0!