From eacb6380992f07b94212291503b0c7a2b599fc9d Mon Sep 17 00:00:00 2001 From: Keepers Date: Fri, 23 Dec 2022 17:10:49 -0700 Subject: [PATCH] do not wait on deleted collections (#1953) ## Type of change - [x] :bug: Bugfix ## Issue(s) * #1950 ## Test Plan - [x] :muscle: Manual --- src/internal/connector/data_collections.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/internal/connector/data_collections.go b/src/internal/connector/data_collections.go index 4057aafda..ad630e36a 100644 --- a/src/internal/connector/data_collections.go +++ b/src/internal/connector/data_collections.go @@ -56,8 +56,16 @@ func (gc *GraphConnector) DataCollections( return nil, err } - for range colls { - gc.incrementAwaitingMessages() + for _, c := range colls { + // kopia doesn't stream Items() from deleted collections, + // and so they never end up calling the UpdateStatus closer. + // This is a brittle workaround, since changes in consumer + // behavior (such as calling Items()) could inadvertently + // break the process state, putting us into deadlock or + // panics. + if c.State() != data.DeletedState { + gc.incrementAwaitingMessages() + } } return colls, nil