mirror of
https://github.com/docker/compose.git
synced 2026-09-28 02:23:42 +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 <nicolas.deloof@gmail.com>
This commit is contained in:
parent
f7744a872f
commit
eb9e1fa127
1 changed files with 8 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue