MPS issue job004067

TitleTelemetry interacts poorly with fork
Statusopen
Prioritynice
Assigned userGareth Rees
OrganizationRavenbrook
DescriptionForking a process that's outputting telemetry has these problems:

1. The parent and child continue to use the same file handle, and so their telemetry output will be mixed into the same file.
2. At the point where the fork happens, there may be logged events in the telemetry buffers; these get output by both the parent and child after the fork even though they only happened in the parent.
3. Clock values (in EventClockSync events) go back to zero in the child process (see job004098).
Analysis1. Close the telemetry file in the child and open a new one. We could deduplicate these by using the process id in some way, but beware process id wrap-around.
2. Call EventSync in the prepare handler so that the buffers are empty at the point where fork happens.
How foundinspection
EvidenceNone
Created byGareth Rees
Created on2018-06-14 12:25:55
Last modified byGareth Rees
Last modified on2018-07-23 14:18:55
History2018-06-14 GDR Created.