Bug #884
closedsessiond sends a "disable event" command to agents for each event, enabled or not, on session destroy
100%
Description
When a session is destroyed, the session daemon sends a "disable event" command to all the agents, for each event, enabled or not.
This is problematic because agents typically keep a reference count of enabled events so that they may avoid calling the UST tracepoint when it's not necessary (when the ref count is 0). With this bug, the following situation can happen:
- create session A [ref count = 0, will not call
tracepoint()
] - session A: enable event E for domain D [ref count = 1, will call
tracepoint()
] - create session B [ref count = 1]
- session B: enable event E for domain D [ref count = 2]
- session B: disable event E for domain D [ref count = 1]
- session B: destroy [ref count = 0, will not call
tracepoint()
] - session A: start
- ...
- session A: stop
The double-disable in session B makes the agent's internal reference count go back to 0, which disables the calls to tracepoint()
. This results in session A having no recorded events E, even if they occured and event E was still enabled.
Files
Updated by Philippe Proulx over 9 years ago
- File 0001-Fix-Java-agent-update-ref-count-in-enabledLoggers.patch 0001-Fix-Java-agent-update-ref-count-in-enabledLoggers.patch added
Attaching a patch for LTTng-UST (applies on 2.6-stable) which:
- fixes LTTng-UST's Java agent so that it actually uses reference counting;
- works with both fixed and non-fixed versions of sessiond.
The Java agent looks at the version of the registration done command sent by sessiond to know if it's fixed or not:
- 0: fixed;
- > 0 means fixed.
Updated by Philippe Proulx over 9 years ago
Philippe Proulx wrote:
- 0: fixed;
- > 0 means fixed.
Of course what I meant is:
- 0: not fixed;
- > 0: fixed.
Updated by Philippe Proulx over 9 years ago
- File 0001-Fix-Java-agent-update-ref-count-in-enabledLoggers.patch 0001-Fix-Java-agent-update-ref-count-in-enabledLoggers.patch added
Attaching a patch for LTTng-UST (applies on 2.7-stable) which fixes the ref count update of the Java agent when it is known that the connected sessiond has fixed #884.
Updated by Jérémie Galarneau over 9 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Applied in changeset tools|commit:f1bc01296844846c89e13f34376461f57387d999.