Open xuxiaofan1203 opened 7 months ago
Hard to understand what case you are really pointing to. Can you provide an example(you can add sleeps if you want to cause a specific race) or propose a fix.
A similar problem occurs when the push.Push
method is called concurrently, not sure if it is related to us using the same context.Context
between multiple goroutines.
Like the test in packege flightcontrol below:
When executes this code segment
if err=nil, the cancel in Go doesn't execute.Then g.Do() executes, and the call chains are g.do() -> newcall() -> go c.progressState.run(pr) -> pr.Read() -> Wait() in Read(): due to cancel doesn't execute, and pr.cond.Broadcast() doesn't execute as well. As a result, there isn't a signal() or broadcast() can awaken the Wait()