MCPcopy
hub / github.com/docker/docker-agent / Fail

Method Fail

pkg/tools/lifecycle/state.go:109–115  ·  view source on GitHub ↗

Fail transitions to s and records err as the last error. Use this when entering Failed/Restarting after a failure so the supervisor's snapshot surfaces a useful message.

(s State, err error)

Source from the content-addressed store, hash-verified

107// entering Failed/Restarting after a failure so the supervisor's snapshot
108// surfaces a useful message.
109func (t *Tracker) Fail(s State, err error) {
110 t.mu.Lock()
111 defer t.mu.Unlock()
112 t.state = s
113 t.since = time.Now()
114 t.lastErr = err
115}
116
117// IncRestarts increments the restart counter and returns the new value.
118func (t *Tracker) IncRestarts() int {

Callers 6

TestTracker_ConcurrentFunction · 0.95
StartMethod · 0.80
watchMethod · 0.80
tryRestartMethod · 0.80

Calls 3

NowMethod · 0.80
LockMethod · 0.45
UnlockMethod · 0.45

Tested by 3

TestTracker_ConcurrentFunction · 0.76