Bug #598
closedCalling stop_tracing() from the Python bindings does not ensure the trace is readable on return
0%
Description
Some Python tests have been failing randomly for some time on the CI. It seems that the reason for the failure is that Babeltrace tries to open a trace which turns out to be empty.
These tests basically all operate the same way:
- create a session
- enable all events
- start the tracing
- launch a test application
- stop the session
- destroy the session
- launch Babeltrace to read the trace
Stopping the trace is currently done by launching a sub-process that invokes "lttng stop". However, it does not wait for the process to finish before trying to read the trace.
The patch attached to this bug report forgoes this mechanism completely and calls lttng_stop_tracing() via the Python bindings. However, the error still occurs which leads me to believe the lttng_stop_tracing() call does not really ensure the trace data is flushed to disk.
Note that this patch also modifies the lttng-tools/tests/regressions/ust/fork/test_fork test to print Babeltrace's stderr output as diagnostic.
$ ./test_fork 1..6 ok 1 - Fork test application exited normally Waiting for data availability not ok 2 - Resulting trace is readable #[error] Encountered an empty file, but expecting a trace packet header. #[error] Stream index creation error. #[error] Open file stream error. #[warning] [Context] Cannot open_trace of format ctf at path /tmp/tmp68ecst/b99f4e80-efe5-11e2-b4ca-00248c0e622f/ust/pid/fork2-19302-20130718-160751. #[warning] [Context] cannot open trace "/tmp/tmp68ecst/b99f4e80-efe5-11e2-b4ca-00248c0e622f/ust/pid/fork2-19302-20130718-160751" from /tmp/tmp68ecst/b99f4e80-efe5-11e2-b4ca-00248c0e622f for reading. #[warning] errors occurred when opening trace "/tmp/tmp68ecst/b99f4e80-efe5-11e2-b4ca-00248c0e622f" for reading, continuing anyway. # Bail out! # Unreadable trace; can't proceed with analysis.
Files
Updated by Jérémie Galarneau over 11 years ago
- Subject changed from Calling lttng_stop_tracing() does not ensure the trace is readable on return to Calling stop_tracing() from the Python bindings does not ensure the trace is readable on return
- Priority changed from Normal to Low
This problem can't be reproduced from a test completely written in C which points to the Python bindings being the problem.
Updated by David Goulet over 11 years ago
- Status changed from New to Confirmed
- Assignee set to Jérémie Galarneau
- Target version deleted (
2.4)
Updated by Jérémie Galarneau over 10 years ago
We can simplify the implementation of the stop Python bindings since lttng-ctl's printing to stdout behavior has been fixed.
commit 8eb7a5e2b9006c5f675c3809055e8abcdffcdb6f Author: Jérémie Galarneau <jeremie.galarneau@efficios.com> Date: Wed May 7 14:27:45 2014 -0400 Fix: Don't output to stdout from lttng-ctl Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com> Signed-off-by: David Goulet <dgoulet@efficios.com>
Updated by Jérémie Galarneau about 10 years ago
- Status changed from Confirmed to Resolved