]> git.evergreen-ils.org Git - working/Evergreen.git/commit
1. Degrade (relatively) gracefully when the database connection dies.
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 24 Jun 2010 17:15:16 +0000 (17:15 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 24 Jun 2010 17:15:16 +0000 (17:15 +0000)
commit80b7b28b9e17c439330a796255da59c6ae17849b
treef11c3c8a99d8e08b60c0b3e266fa60f9e7792417
parentd380726aa9ac4f9374944bb549d201985c29adc7
1. Degrade (relatively) gracefully when the database connection dies.

Problem to be solved: a server drone that loses its database connection
immediately becomes unusable.  It might manage to reconnect, but that
wouldn't help if a transaction was in progress at the time of the failure.

If the drone merely reports an error and then makes itself available
for more requests, every request that it services thereafter will fail.
It will continue to fail repeatedly until it reaches the max_requests
limit, or until someone kills it manually.

Solution: terminate immediately, without waiting for max_requests or a
DISCONNECT request.  The listener can replace it with a new drone,
which will try to establish its own database connection.

2. Correct an oversigt in doUpdate() and doDelete().

If the database operation fails, report an error to the client.
The old code would log an error message but otherwise behave as if
the operation had succeeded.

It is conceivable that this change will appear to break something,
because an operation will fail that would otherwise have appeared
to succeed.  However if that happens, whatever breaks was already
broken; the appearance of success was a snare and a delusion.

M    Open-ILS/include/openils/oils_sql.h
M    Open-ILS/src/c-apps/oils_sql.c

git-svn-id: svn://svn.open-ils.org/ILS/trunk@16808 dcc99617-32d9-48b4-a31d-7c20da2025e4
Open-ILS/include/openils/oils_sql.h
Open-ILS/src/c-apps/oils_sql.c