Bug 35111: Ignore SIGPIPE in background jobs worker
authorDavid Cook <dcook@prosentient.com.au>
Fri, 20 Oct 2023 01:15:00 +0000 (01:15 +0000)
committerMatt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Mon, 13 Nov 2023 15:10:51 +0000 (15:10 +0000)
commit53f8ad42f9285b7ef1a2450b6aaa75566b62b4a0
tree508cd9fae1b608749906cb510512f658ac13c088
parentf7ba4d1a3062d5d501ebba483f8921618ed9a9cd
Bug 35111: Ignore SIGPIPE in background jobs worker

This change explicitly ignores SIGPIPE signals in the background jobs
worker.

Daemons like Starman ignore SIGPIPE so it makes sense to explicitly set this.
Differences in the inner workings of MySQL vs MariaDB client libraries have yielded
different behaviours in automatic reconnections and potentially SIGPIPE handling,
so this helps to make the overall behaviour more consistent.

Test plan:
0. Apply patch and run "restart_all"
1. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
2. Click "Save" > "MARCXML"
3. Go to http://localhost:8081/cgi-bin/koha/tools/stage-marc-import.pl
4. Click "Choose file", choose the MARCXML file, click "Upload file"
5. Click "Stage for import"
6. Note the job is marked as "100% Finished"

7. In a separate window run "docker restart koha-db-1"
8. Repeat steps 3-5 for uploading file and running stage for import
9. Note that the job is marked as "100% Finished" as you'd expect

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Added comment on the SIG PIPE line.
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2988c549719197a5a46a94039f7881b3e74e6e19)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b57dfb84bccd81c92e0c9176acf42043e0ac8363)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
misc/workers/background_jobs_worker.pl