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 22:57:49 +0000 (17:57 -0500)
commit445fe60d5571382fd203cfb4ab32030e29fc490b
treef8234781ef481d408a90efa6f654bd55fc1b07c5
parent7a391832ea3d70a71e00b76398259c5aa7d18541
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>
Conflicts:
src/bin/lttng-sessiond/ust-app.c
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.028877 seconds and 4 git commands to generate.