docs(logs): why a timestampless exit is dropped, not patched

Review finding on runEndTracker.Observe: recording nothing for an exit
event without a timestamp is the deliberate choice — the anchor is
evaluated by the daemon against its own log clock, so substituting the
local clock would introduce real skew mis-anchoring to paper over a
hypothetical daemon quirk, while dropping only degrades that container
to the pre-tracker fallback.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2026-09-22 11:09:36 +02:00 • committed by Nicolas De loof
parent f7744a872f
commit eb9e1fa127

View file

@ -164,7 +164,14 @@ func newRunEndTracker() *runEndTracker {
return &runEndTracker{ends: map[string]int64{}}
}
// Observe records exit events (other event types are ignored).
// Observe records exit events (other event types are ignored). An exit
// carrying no timestamp is deliberately dropped rather than patched with the
// local clock: the anchor is compared by the DAEMON against its own
// container-log timestamps, so substituting our clock would trade a
// hypothetical daemon quirk for real clock-skew mis-anchoring. Dropping it
// merely degrades that container to the logsSinceLastRun fallback — the
// exact pre-tracker behavior, imperfect only for a run fast enough to have
// finished again by inspection time.
func (t *runEndTracker) Observe(e api.ContainerEvent) {
if e.Type != api.ContainerEventExited || e.Time == 0 {
return