Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
concurrency: extend testing for waitQueueMaxLengthExceeded
This patch adds a test for the rare scenario where a request re-scans the lock table and finds itself already waiting at a lock. We test the case where adding a new request to the lock's wait queue would cause the waitQueueMaxLengthExceeded state to be triggered -- however, this shouldn't happen, as the request has already been accounted for. Note that this wasn't broken; we're only adding a test here to ensure we don't regress this behavior as we go about refactoring `tryActiveWait`. Tested using the diff below and confirmed the test does indeed fail: ``` --- a/pkg/kv/kvserver/concurrency/lock_table.go +++ b/pkg/kv/kvserver/concurrency/lock_table.go @@ -1706,7 +1706,7 @@ func (l *lockState) tryActiveWait( defer g.mu.Unlock() if str == lock.Intent { var qg *queuedGuard - if _, inQueue := g.mu.locks[l]; inQueue { + if _, inQueue := g.mu.locks[l]; inQueue && false { ``` Release note: None Informs: #102210
- Loading branch information