forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kvstreamer: fix a possible deadlock with high concurrency
Previously, it was possible for the `Streamer` to get into a deadlock situation when async requests have exausted the concurrency limit. This could happen because: - the worker coordinator goroutine is holding the budget's mutex when it is issuing new async requests. When the semaphore is at its limit, the worker coordinator would block trying to acquire the quota of 1 for spinning up a new goroutine; - however, the quota would never open up because all concurrency async requests could get stuck trying to release some memory back to the budget. This is now fixed by teaching the worker coordinator to proactively check how many requests it can issue (i.e. how much quota it can get from the semaphore) and issuing no more than that number. Additionally, a minor change to the concurrency cluster setting is made to allow only positive values (0 should be prohibited). Release note: None
- Loading branch information
1 parent
6c9f670
commit f5153e4
Showing
2 changed files
with
63 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters