Fix: close indexes when rotating the trace files
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 14 lines · Julien Desfossez
The consumer needs to close the old index file when doing a file rotation before opening a new one.
The relay does not have this problem (handled with refcounts).Signed-off-by Julien Desfossez <[email protected]>--- src/common/consumer/consumer.c | 5 +++++ 1 file changed, 5 insertions(+)src/common/consumer/consumer.c +0
-0
src/common/consumer/consumer.c ssize_t lttng_consumer_on_read_subbuffer_splice( · line 1786
Quoted 8 lines
src/common/consumer/consumer.c +5
-0@@ -1779,6 +1779,11 @@ ssize_t lttng_consumer_on_read_subbuffer_splice( outfd = stream->out_fd;if (stream->index_fd >=0 ) { + ret =close (stream->index_fd); +if (ret <0 ) { +PERROR ("Closing index" ); + goto end; + }
Good catch! I'm adding "stream->index_fd = -1;" here to make sure the index_fd is not closed a second time (on teardown) should the index file creation fail below.
Thanks!
Jérémie
Quoted 6 lines
src/common/consumer/consumer.c +0
-1ret = index_create_file(stream->chan->pathname, stream->name, stream->uid, stream->gid, stream->chan->tracefile_size, --1.9.1
Signature · 8 lines
Jérémie Galarneau EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev