Fix: relayd: tracefile rotation: viewer opening missing index file
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 1 Nov 2019 20:23:03 +0000 (16:23 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 6 Nov 2019 19:35:10 +0000 (14:35 -0500)
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 <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>

No differences found
This page took 0.025104 seconds and 4 git commands to generate.