test(lockservice): isolate forwarded lock timeout assertion - #27813
Conversation
23a2a4f to
52d5c30
Compare
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
52d5c30 to
ecc0b04
Compare
ecc0b04 to
49aacf6
Compare
|
Unrelated CI blocker: |
c26f323 to
24a27ae
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review completed on exact head 24a27ae.
The test-only change correctly separates the uncontended forwarded holder setup from the waiter-specific one-second budget. Lock receives options by value and service-side deadline injection does not mutate the caller copy, so setting LockWaitTimeout = 1 after holder acquisition applies only to the conflicting waiter. The holder still exercises background-context safety-deadline injection, while the waiter retains the intended timeout/error and timing oracle.
Unhappy-path/liveness: the waiter remains bounded by its effective deadline; harness teardown owns service/txn cleanup, and repeated race execution found no leaked or stale shared state. No production, protocol, or hot-path behavior changes.
Evidence: exact test selection was non-empty; focused normal passed; focused race -count=20 passed in 23.769s; exact-head Ubuntu/x86 UT, SCA, coverage, and BVT checks are green. No blocking findings.
Merge Queue Status
This pull request spent 14 seconds in the queue, including 1 second running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
Related to #27810
What this PR does / why we need it:
The race failure was a test-fixture timing error, not a lockservice production failure. The test used LockWaitTimeout = 1 for both the uncontended forwarded holder setup and the blocked waiter assertion. Each Lock call receives an independent end-to-end effective deadline, so scheduling, binding, forwarding, and owner admission can legitimately exhaust the holder setup request before the test reaches the waiter assertion.
This change leaves the holder request on the existing service safety deadline, preserving the background-context deadline-injection coverage. It applies the one-second lock wait timeout only to the subsequent conflicting waiter, which is the operation whose ErrLockWaitTimeout behavior and timing the test asserts. No production code or protocol behavior changes.
Issue-to-test proof:
Tests run:
BVT is not applicable: this is an internal lockservice forwarding fixture and does not change SQL-visible behavior.
Residual risk: