Fix: consumer socket lock not held during snapshot record
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 14 Feb 2018 21:13:51 +0000 (16:13 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 15 Feb 2018 20:13:28 +0000 (15:13 -0500)
commit705c13ed534670994e761d4d79742c3f95b7140c
tree1e9a68c130c85e58bfe8aa4a886f3be7889c1d88
parent14c6c4418bf7c18227236e2a87b84ee7a5c3a838
Fix: consumer socket lock not held during snapshot record

This missing lock was identified while stress-testing the
snapshot tracing mode.

The "post_mortem" test case would sometimes hang on a
push_metadata() call waiting for a status reply from the
consumer daemon.

This test demonstrated a race that consists in killing an
application and taking a snapshot near-simultaneously.

This causes the app management thread to issue a "push metadata"
command to the consumerd while the lttng client is issuing
a snapshot record command.

Since the snapshot record does not acquire the consumer socket lock,
the "push metadata" and "snapshot" commands end-up mixed-up on
the socket which ultimately causes the "apps management" thread
to wait for a reply forever while holding the socket's lock.

This prevents the client, invoked by the test script, from
completing the "stop" operation on the session.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/consumer.c
This page took 0.025244 seconds and 4 git commands to generate.