Signal forwarding traceback #368
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#368
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?
Reported by f0x.
What I'm trying to do and why
Send a signal to borgmatic and have it be forwarded on to Borg. (In this case, SIGUSR1 for instrumentation purposes. But applies to other signals too.)
Steps to reproduce (if a bug)
Start a
borgmatic create
such that it invokes Borg. While Borg is running:Actual behavior (if a bug)
Expected behavior (if a bug)
No traceback, and borgmatic forwards the signal onto Borg.
Other notes / implementation ideas
The problem here is that borgmatic's existing signal handler forwards the signal to borgmatic's entire process group, which include child processes like Borg. And while that means Borg receives the forwarded signal as designed, it also means borgmatic re-receives its own forwarded signal (being in the same process group).
Then the signal gets handled again, gets forwarded again, repeat ad infinitum.
Boom, stack blown.
Environment
borgmatic version: 1.5.10, master (1.5.11.dev0)
borgmatic installation method:
pip install --editable
Borg version: 1.1.14
Python version: 3.8.6
Database version (if applicable): N/A
operating system and version: Manjaro stable
Fixed in master by stopping the infinite recursion when detected. This fix will be part of the next release.
Just released in borgmatic 1.5.11!