[bind10-dev] log4cplus, multi process and multi thread (and #2198)
JINMEI Tatuya / 神明達哉
jinmei at isc.org
Mon Nov 19 12:35:38 UTC 2012
(I'm sending it to the list as we didn't have time for this topic in
the last week's call)
I'm afraid we've got lost in the use of log4cplus with multi processes
and multi threads. The multi-process usage revealed the problem of
mixed logs, and the recent introduction of multi threads introduced
various race conditions and portability issues. To deal with these
we've been developing our own hack at the lower level (not even using
third party tools like the boost interprocess or thread related
modules), such as inter-process file locking and in-house inter thread
locks (the latter is used for other purposes, but we are going to end
up introducing a try-lock primitive just for testing logging usage
of the locks). We've then suffered from all lower level troubles.
IMO we're now losing major advantages of outsourcing non-critical
business: avoid re-inventing wheels and concentrate on our core
business, and yet having drawbacks of increasing dependency. I think
we should revisit our approach based on these lessons, rather than
trying to fix specific issues superficially.
Some options I can see are:
- use our own logging module instead of log4cplus (we'll need to
implement and maintain more ourselves, but we have more control on
the feature and its availability).
- say "use log4cplus 1.1 for advanced stuff like multi-process or
multi-thread" and ask for using some workaround if it cannot be done
(a strawman idea is to separate log files for each process; for
multi-thread issue we may not be able to solve all problems this way
but at least we can minimize the scope of the problems).
The basic point of these options is that, "if we want to outsource
something, outsource most (if not all) part of it; otherwise do most
part of it ourselves".
---
JINMEI, Tatuya
More information about the bind10-dev
mailing list