Page MenuHomePhabricator

Reduce collision rate for concurrency-limiting slot locks
ClosedPublic

Authored by epriestley on Feb 13 2018, 5:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 2:50 AM
Unknown Object (File)
Wed, Apr 3, 2:29 PM
Unknown Object (File)
Sat, Mar 30, 6:50 PM
Unknown Object (File)
Sat, Mar 30, 6:50 PM
Unknown Object (File)
Sat, Mar 30, 6:50 PM
Unknown Object (File)
Sat, Mar 30, 6:50 PM
Unknown Object (File)
Mar 5 2024, 12:43 AM
Unknown Object (File)
Feb 27 2024, 12:57 PM
Subscribers
Restricted Owners Package

Details

Summary

Depends on D19077. Ref T13073. When we're using slot locks to enforce a limit (e.g., maximum of 5 simultaneous things) we currently load locks owned by the blueprint to identify which slots are likely to be free.

However, this isn't right: the blueprint doesn't own these locks. The resources do.

We still get the right behavior eventually, but we incorrectly identify that every slot lock is always free, so as the slots fill up we'll tend to guess wrong more and more often.

Instead, load the slot locks by name explicitly.

Test Plan

Implemented lock-based limiting on HoaxBlueprint, var_dump()'d the candidate locks, saw correct test state for locks. Acquired leases without releasing, got all of the slots filled without any slot lock collisions (previously, the last slot or two tended to collide a lot).

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable