]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
log: broadcast cond signals
authorSage Weil <sage@inktank.com>
Fri, 28 Dec 2012 21:07:18 +0000 (13:07 -0800)
committerSage Weil <sage@inktank.com>
Fri, 4 Jan 2013 00:23:40 +0000 (16:23 -0800)
commit49416619d733572368e5d2ba7f2b34150c754b23
tree595e9fc62579bf64741bd9735f1adb9231f830b1
parentf8bb4814d0fd7e08c9b6cdcde02940bf1b42cadd
log: broadcast cond signals

We were using a single cond, and only signalling one waiter.  That means
that if the flusher and several logging threads are waiting, and we hit
a limit, we the logger could signal another logger instead of the flusher,
and we could deadlock.

Similarly, if the flusher empties the queue, it might signal only a single
logger, and that logger could re-signal the flusher, and the other logger
could wait forever.

Intead, break the single cond into two: one for loggers, and one for the
flusher.  Always signal the (one) flusher, and always broadcast to all
loggers.

Backport: bobtail, argonaut
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit 813787af3dbb99e42f481af670c4bb0e254e4432)
src/log/Log.cc
src/log/Log.h