[Koha-bugs] [Bug 35111] New: Background jobs worker crashes on SIGPIPE when database connection lost

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Oct 20 01:30:03 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35111

            Bug ID: 35111
           Summary: Background jobs worker crashes on SIGPIPE when
                    database connection lost
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: dcook at prosentient.com.au
        QA Contact: testopia at bugs.koha-community.org

Typically, if Koha loses a connection to the database, it will automatically
reconnect. We expect the background jobs worker to do the same thing.

However, I've noticed that instead of reconnecting it crashes with an error
like this in the worker-error.log:

20231018 07:44:06 instance-koha-worker-long_tasks: client (pid 3949888) killed
by signal 13, respawning

Signal 13 is a SIGPIPE and you will encounter that when you're trying to write
to a socket that is no longer connected. 

Starman is based on Net::Server::PreFork which - like a lot of daemon software
- ignores SIGPIPE. So if you restart the database and Starman loses its
persistent connections, it will reconnect and ignore the SIGPIPE error.

If you restart the database or you have a database connection timeout[1], the
background jobs worker won't ignore the SIGPIPE. It'll die on it, and it will
leave a background job in a stuck state.

[1]
Oct 19 02:24:02 awesome-host mariadbd[959]: 2023-10-19  2:24:02 6432 [Warning]
Aborted connection 6432 to db: 'koha_instance' user: 'koha_instance' host:
'localhost' (Got timeout reading communication packets)

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list