Fix: deadlock between UST registry lock and consumer lock
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 23 Jan 2015 16:29:00 +0000 (11:29 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 23 Jan 2015 21:47:13 +0000 (16:47 -0500)
commitdc2bbdaea73908117fdccc5e8247b613bd3b8600
treec23756a6e86a57a48617b71b16e86aa528c7e1a5
parent99b1411c06926da6c87df96030d6d055076fc5e2
Fix: deadlock between UST registry lock and consumer lock

Reorganize locking of ust registry and consumer socket communication.

commit ce34fcd0 "Fix: per-uid flush and ust registry locking" attempted
to fix locking related to the UST registry, but doing so introduced a
deadlock. The actual solution is to reverse the order in which the UST
registry and the consumer lock nest: the UST registry will now to
responsible for serializing the registry content, and the consumer lock
will only protect communication with the consumer, as it should. This
deals with a TODO in the code.

The reason why this was not done from the beginning is that there was
originally an intent to make sure the ust registry lock is not held for
a long time, thus not while communicating with the consumer daemon.
However, when live has been implemented, it required communication with
the consumer daemon while the ust registry is held anyway. Therefore,
there is not much point anymore in trying to make sure this lock is not
held across the communication with consumerd in push_metadata. This
allows us to greatly simplify locking of the UST registry.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/consumer.c
src/bin/lttng-sessiond/ust-app.c
src/bin/lttng-sessiond/ust-consumer.c
src/bin/lttng-sessiond/ust-registry.h
This page took 0.026673 seconds and 4 git commands to generate.