BUG/MINOR: logs: properly initialize and count log sockets
authorWilly Tarreau <w@1wt.eu>
Mon, 23 Jun 2014 16:07:15 +0000 (18:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 23 Jun 2014 16:15:12 +0000 (18:15 +0200)
commitc7c7be21bf6c7e9afd897d4bf451dc450187a77e
tree424ff05b69fe734f709865217e4afc9f32767f8a
parent6f0a7bac282c9b2082dc763977b7721b6b002089
BUG/MINOR: logs: properly initialize and count log sockets

Commit 81ae195 ("[MEDIUM] add support for logging via a UNIX socket")
merged in 1.3.14 introduced a few minor issues with log sockets. All
of them happen only when a failure is encountered when trying to set
up the logging socket (eg: socket family is not available or is
temporarily short in resources).

The first socket which experiences an error causes the socket setup
loop to abort, possibly preventing any log from being sent if it was
the first logger. The second issue is that if this socket finally
succeeds after a second attempt, errors are reported for the wrong
logger (eg: logger #1 failed instead of #2).  The last point is that
we now have multiple loggers, and it's a waste of time to walk over
their list for every log while they're almost always properly set up.

So in order to fix all this, let's merge the two lists. If a logger
experiences an error, it simply sends an alert and skips to the next
one. That way they don't prevent messages from being sent and are
all properly accounted for.
src/log.c