mirror of
https://github.com/docker/compose.git
synced 2026-10-12 02:13:08 +00:00
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 <[email protected]>
This commit is contained in:
committed by
Nicolas De loof
parent
f7744a872f
commit
eb9e1fa127
+8
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user