Potential deadlock or goleak in lib/semaphore/semaphore.go#66 #9433
Labels
bug
A problem with current functionality, as opposed to missing functionality (enhancement)
needs-triage
New issues needed to be validated
In the case, s.Take(75) and s.SetCapacity(10) are called. At the moment, size = max = 10 and available = 0, if s.Take(75) is called again,
the goroutine will block at s.cond.Wait() even if s.Give(75) is called after that. I think the result is strange, the Wait() should block due to available = 0, but if there are enough available later, the Wait() should be signaled instead of causing a deadlock or goleak.
The text was updated successfully, but these errors were encountered: