Signal forwarding traceback #368
Reference in New Issue
Block a user
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?
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 createsuch 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 --editableBorg 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!