Skip to content

Commit 9146029

Browse files
authored
Fix a deadlock situation for BlockOnSplit test case. (#36226)
1 parent 350537f commit 9146029

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sdks/go/pkg/beam/core/runtime/exec/dynsplit_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,10 @@ func (rt *splitTestRTracker) TryClaim(pos any) bool {
376376
rt.claim <- struct{}{}
377377
}
378378

379-
rt.mu.Lock()
380379
if i == rt.blockInd {
381380
rt.blockClaim <- struct{}{}
382381
}
382+
rt.mu.Lock()
383383
result := rt.rt.TryClaim(pos)
384384
rt.mu.Unlock()
385385

@@ -396,9 +396,9 @@ func (rt *splitTestRTracker) GetError() error {
396396
}
397397

398398
func (rt *splitTestRTracker) TrySplit(fraction float64) (any, any, error) {
399+
rt.blockSplit <- struct{}{}
399400
rt.mu.Lock()
400401
defer rt.mu.Unlock()
401-
rt.blockSplit <- struct{}{}
402402
return rt.rt.TrySplit(fraction)
403403
}
404404

0 commit comments

Comments
 (0)