uber-go / cadence-client

Framework for authoring workflows and activities running on top of the Cadence orchestration engine.
https://cadenceworkflow.io
MIT License
350 stars 131 forks source link

Fix parent vs child race #1141

Closed demirkayaender closed 3 years ago

demirkayaender commented 3 years ago

What changed? Added locks around the code we access the children object which should prevent the race condition

AddChildCancelParent test is taken from https://github.com/uber-go/cadence-client/pull/1139

Why? Without this fix, we cause shutdown crashes

How did you test it? go test -race -test.count 1 -test.run TestChildParentCancelRace ./internal and go test -race ./internal to run them all

Potential risks

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build e7dd0b6f-f683-4be8-83d1-b1975e0ee16b


Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/context.go 24 25 96.0%
<!-- Total: 24 25 96.0% -->
Totals Coverage Status
Change from base Build 23625b2f-f895-4e62-be1e-e45768586dbe: 0.08%
Covered Lines: 12202
Relevant Lines: 19296

💛 - Coveralls