From: Mathieu Desnoyers Date: Fri, 23 Jan 2015 16:29:00 +0000 (-0500) Subject: Fix: deadlock between UST registry lock and consumer lock X-Git-Tag: v2.5.4~5 X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=445fe60d5571382fd203cfb4ab32030e29fc490b;hp=445fe60d5571382fd203cfb4ab32030e29fc490b;p=lttng-tools.git 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 Signed-off-by: Jérémie Galarneau Conflicts: src/bin/lttng-sessiond/ust-app.c ---