1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-16 10:20:02 +02:00
pgbackrest/test/lib/pgBackRestTest/Common
David Steele e2c304d473 Prevent defunct processes in asynchronous archive commands.
The main improvement is a double-fork to prevent zombie processes if the parent process exits after the (child) async process. This is a real possibility since the parent process sticks around to monitor the results of the async process.

In the first fork, ignore SIGCHLD in the very unlikely case that the async process exits before the first fork. This is probably only possible if the async process exits immediately, perhaps due to a chdir() failure. Set SIGCHLD back to default in the async process so waitpid() will work as expected.

Also update the comment on chdir() to more accurately reflect what is happening.

Finally, add a test in certain debug builds to ensure the first fork exits very quickly. This only works when valgrind is not in use because valgrind makes forking so slow that it is hard to tell if the async process performed work or not (in the case that the second fork goes missing and the async process is a direct child).
2020-02-12 12:17:23 -07:00
..
BuildTest.pm Make buildPutDiffers() work with empty files. 2019-12-10 13:02:36 -05:00
CodeCountTest.pm Reclassify Perl and LibC code as test/harness. 2020-01-15 13:53:30 -07:00
ContainerTest.pm Use pkg-config instead of xml2-config for libxml2 build options. 2020-01-24 10:08:05 -07:00
CoverageTest.pm Automate coverage summary report generation. 2019-05-15 13:04:56 -04:00
DefineTest.pm pgBackRest is now pure C. 2019-12-13 17:55:41 -05:00
ExecuteTest.pm Remove test point infrastructure. 2019-12-10 13:16:47 -05:00
FileTest.pm Remove pgbackrest test user. 2019-10-12 09:45:18 -04:00
HostGroupTest.pm Use minio as local S3 emulator in documentation. 2019-05-27 07:37:20 -04:00
HostTest.pm Use minio as local S3 emulator in documentation. 2019-05-27 07:37:20 -04:00
JobTest.pm Prevent defunct processes in asynchronous archive commands. 2020-02-12 12:17:23 -07:00
ListTest.pm pgBackRest is now pure C. 2019-12-13 17:55:41 -05:00
LogTest.pm Auto-select backup set on restore when time target is specified. 2020-01-30 14:38:05 -07:00
RunTest.pm Integration test improvements for disk and memory efficiency. 2019-12-17 15:23:07 -05:00
Storage.pm Add storage layer for tests and documentation. 2019-06-17 09:16:44 -04:00
StoragePosix.pm Fix regexp to ignore ./.. directories in the Posix driver. 2019-08-22 10:18:34 -04:00
StoragePosixRead.pm Add storage layer for tests and documentation. 2019-06-17 09:16:44 -04:00
StoragePosixWrite.pm Add storage layer for tests and documentation. 2019-06-17 09:16:44 -04:00
VmTest.pm Only install specific lcov version when required. 2019-11-22 19:25:49 -05:00