refactor garbagecollection controllers to make forget impossible to forget

This commit is contained in:
astraw99
2022-01-09 15:15:03 +08:00
parent d2c9456963
commit a5a54754d5
2 changed files with 54 additions and 21 deletions

View File

@@ -460,7 +460,7 @@ func TestDependentsRace(t *testing.T) {
defer wg.Done()
for i := 0; i < updates; i++ {
gc.attemptToOrphan.Add(owner)
gc.attemptToOrphanWorker()
gc.processAttemptToOrphanWorker()
}
}()
wg.Wait()
@@ -2445,7 +2445,7 @@ func processAttemptToDelete(count int) step {
if count <= 0 {
// process all
for ctx.gc.dependencyGraphBuilder.attemptToDelete.Len() != 0 {
ctx.gc.attemptToDeleteWorker(context.TODO())
ctx.gc.processAttemptToDeleteWorker(context.TODO())
}
} else {
for i := 0; i < count; i++ {
@@ -2453,7 +2453,7 @@ func processAttemptToDelete(count int) step {
ctx.t.Errorf("expected at least %d pending changes, got %d", count, i+1)
return
}
ctx.gc.attemptToDeleteWorker(context.TODO())
ctx.gc.processAttemptToDeleteWorker(context.TODO())
}
}
},