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

Method Commit

src/go/plugin/framework/chartengine/attempt.go:43–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41}
42
43func (a PlanAttempt) Commit() error {
44 if a.state == nil {
45 return nil
46 }
47
48 a.state.mu.Lock()
49 if a.state.finished {
50 a.state.mu.Unlock()
51 return ErrFinishedPlanAttempt
52 }
53 a.state.finished = true
54 reserved := a.state.reserved
55 engine := a.state.engine
56 materialized := a.state.materialized
57 epoch := a.state.epoch
58 commitSeq := a.state.commitSeq
59 attemptID := a.state.attemptID
60 a.state.mu.Unlock()
61
62 if !reserved {
63 return nil
64 }
65 if engine == nil {
66 return fmt.Errorf("chartengine: nil engine on commit")
67 }
68 return engine.commitAttempt(materialized, epoch, commitSeq, attemptID)
69}
70
71func (a PlanAttempt) Abort() {
72 if a.state == nil {

Callers 7

prepareCommittedPlanFunction · 0.80
prepareAndCommitPlanFunction · 0.80
TestJobV2ScenariosFunction · 0.80
buildPlanFromTemplateFunction · 0.80
commitMethod · 0.80

Calls 4

LockMethod · 0.80
UnlockMethod · 0.80
commitAttemptMethod · 0.80
ErrorfMethod · 0.65

Tested by 3

prepareCommittedPlanFunction · 0.64
TestJobV2ScenariosFunction · 0.64