Commit Graph

17 Commits

Author SHA1 Message Date
Paul D 253d8e8d4e Docs grammar fixes
joined split infinitives, and relocated adverbs appropriately.
2022-12-29 22:26:54 +00:00
Rayyan Ansari 5e8452a705 archiver: create_cmd: do not add preexec_fn on Windows
The preexec_fn argument of Popen is not supported on Windows.
2022-12-18 14:00:35 +00:00
Thomas Waldmann 4d570497be ctrl-c must not kill other subprocesses, fixes #6912
There are some other places with subprocesses:

- borg create --content-from-command
- borg create --paths-from-command
- (de)compression filter process of import-tar / export-tar
2022-08-06 23:37:38 +02:00
Thomas Waldmann 0ab82d57e4 ctrl-c must not kill the ssh subprocess, fixes #6912 2022-08-06 23:27:00 +02:00
Thomas Waldmann 7957af562d blacken all the code
https://black.readthedocs.io/
2022-07-06 16:34:38 +02:00
Thomas Waldmann 18eb696a17 fix create_filter_process exception handler, fixes #6681
if cmd was falsy (e.g. None), there is no proc.
then, if "yield stream" raises an exception, the exception handler crashed at "proc.kill()".
2022-05-08 18:46:13 +02:00
Thomas Waldmann 83deedb13a kill filter process in case of borg exceptions, fixes #6401
in the finally-block, we wait for the filter process to die. but it only dies
voluntarily if all data was processed by the filter and it terminates due to EOF.

otoh, if borg has thrown an early exception, e.g. "archive already exists",
we need to kill the filter process to bring it to an early end. in that
case, we also do not need to check the filter rc, because we know we killed it.
2022-03-05 16:25:10 -05:00
Thomas Waldmann cbeef56454 pyupgrade --py38-plus ./**/*.py 2022-02-27 20:11:56 +01:00
Thomas Waldmann 5a13416a80 fix pyinstaller detection for dir-mode, fixes #5897
"running under pyinstaller" detection is now as recommended by the pyinstaller docs.
2021-07-11 00:26:50 +02:00
Thomas Waldmann de84440c18 use context manager for filter process setup/teardown 2021-06-14 16:03:49 +02:00
Thomas Portmann ef9fdcf992 fix race condition in lock migration, fixes #4953
- add a daemonizing() ctx manager

The foreground borg mount process (local repo) survives until the lock
migration (performed by the background) is finished, so the lock to be
migrated is never stale, and the race condition is gone.

- add a test case revealing that locking is not safe during daemonization (borg mount)

- amend printing in testsuite.archiver
2020-07-09 21:31:13 +02:00
Thomas Waldmann 9732fe4965 special behaviour on first ctrl-c, fixes #4606
like:
 - try saving a checkpoint if borg create is ctrl-c-ed
2019-08-25 22:49:09 +02:00
Emmo Emminghaus 733a2bfa30 Introduce borg.platformflags.is_<os> 2018-11-10 23:34:43 +01:00
Thomas Waldmann b5069770b7 fix LDLP restoration for subprocesses, fixes #3077 2017-10-01 19:17:23 +02:00
Thomas Waldmann ba941b0801 refactor/fix subprocess env preparation
refactor: make a generally usable function

fix: remove support code for ancient pyinstaller

the "else" branch was needed for pyinstaller < 20160820 because it did
not have the LD_LIBRARY_PATH_ORIG env var, so we just killed LDLP
because we had no better way.

but with borg tests running under fakeroot, this is troublesome as
fakeroot uses this also and can't find its library without it.

so, just remove it, we do not need to support old pyinstaller.
2017-09-25 04:34:58 +02:00
Thomas Waldmann 6f94949a36 migrate locks to child PID when daemonize is used
also:

increase platform api version due to change in get_process_id behaviour.
2017-08-08 03:46:44 +02:00
Thomas Waldmann 3e78549f76 helpers: split into smaller modules 2017-08-07 23:05:46 +02:00