MCPcopy Index your code
hub / github.com/netdata/netdata / commitAttempt

Method commitAttempt

src/go/plugin/framework/chartengine/attempt.go:141–160  ·  view source on GitHub ↗
(materialized materializedState, epoch, commitSeq, attemptID uint64)

Source from the content-addressed store, hash-verified

139}
140
141func (e *Engine) commitAttempt(materialized materializedState, epoch, commitSeq, attemptID uint64) error {
142 if e == nil {
143 return fmt.Errorf("chartengine: nil engine")
144 }
145 e.mu.Lock()
146 defer e.mu.Unlock()
147
148 if e.state.outstanding != attemptID || e.state.outstanding == 0 {
149 return ErrStalePlanAttempt
150 }
151 if e.state.engineEpoch != epoch || e.state.commitSeq != commitSeq {
152 e.state.outstanding = 0
153 return ErrStalePlanAttempt
154 }
155
156 e.state.materialized = materialized
157 e.state.commitSeq++
158 e.state.outstanding = 0
159 return nil
160}
161
162func (e *Engine) abortAttempt(attemptID uint64) {
163 if e == nil {

Callers 1

CommitMethod · 0.80

Calls 3

LockMethod · 0.80
UnlockMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected