From: Mathieu Desnoyers Date: Fri, 1 Nov 2019 20:23:03 +0000 (-0400) Subject: Fix: relayd: tracefile rotation: viewer opening missing index file X-Git-Tag: v2.12.0-rc1~256 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=78118e3bdace1208479db18df6553ab9c4400426;hp=78118e3bdace1208479db18df6553ab9c4400426 Fix: relayd: tracefile rotation: viewer opening missing index file Moving the head position of the tracefile array when the data is received opens a window where a viewer attaching to the session could try to open a missing index file (which has not been received yet). However, we want to bump the tail position as soon as we receive data, because the prior tail is not valid anymore. Solve this by introducing two head positions: the "read" head and the "write" head. The "write" head is the position of the newest data file (equivalent to the prior "head" position). We also introduce a "read" head position, which is only moved forward when the index is received. The viewer now uses the "read" head position as upper bound, which ensures it never attempts to open a non-existing index file. Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau ---