this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/core/adt: decrement counter for defunct tasks

Not decrementing them can cause counter errors.

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I2a0922737e7e4b3f40973aa1b6e918ae3dfc4fc9
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1199753
Reviewed-by: Matthew Sackman <matthew@cue.works>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>

+7 -3
+7 -3
internal/core/adt/sched.go
··· 123 123 taskWAITING // task is blocked on a property of an arc to hold 124 124 taskSUCCESS 125 125 taskFAILED 126 + taskCANCELLED 126 127 ) 127 128 128 129 type schedState uint8 ··· 405 406 } 406 407 407 408 switch { 408 - case t.defunct: 409 - continue 410 - 411 409 case t.state == taskRUNNING: 412 410 // TODO: we could store the current referring node that caused 413 411 // the cycle and then proceed up the stack to mark all tasks ··· 671 669 672 670 func runTask(t *task, mode runMode) { 673 671 if t.defunct { 672 + if t.state != taskCANCELLED { 673 + t.state = taskCANCELLED 674 + if t.id.cc != nil { 675 + t.id.cc.decDependent(t.node.ctx, TASK, nil) 676 + } 677 + } 674 678 return 675 679 } 676 680 t.node.Logf("============ RUNTASK %v %v", t.run.name, t.x)