Skip to content

Commit 2214d8d

Browse files
committed
Deviantions: deadlock... fix the fix
1 parent f0de3f9 commit 2214d8d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/datastore/transaction_rpc.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,13 @@ func (d *Datastore) LoadAllButRunningIntents(ctx context.Context, root *tree.Roo
150150
go d.cacheClient.IntentGetAll(ctx, []string{"running"}, IntentChan, ErrChan)
151151

152152
for {
153+
selectLoop:
153154
select {
154155
case err, ok := <-ErrChan:
155156
if !ok {
156157
// ErrChan already closed which is fine, continue
157158
ErrChan = nil
158-
continue
159+
break selectLoop
159160
}
160161
return nil, err
161162
case <-ctx.Done():
@@ -164,7 +165,7 @@ func (d *Datastore) LoadAllButRunningIntents(ctx context.Context, root *tree.Roo
164165
if !ok {
165166
// IntentChan closed due to finish
166167
IntentChan = nil
167-
continue
168+
break selectLoop
168169
}
169170
if excludeDeviations && intent.Deviation {
170171
continue

0 commit comments

Comments
 (0)