Adaptive lock-region controller (Coarse/Medium/Fine, traffic-reactive) #10
Labels
No labels
area/api
area/bridge
area/db
area/docs
area/ops
area/web
kind/bug
kind/chore
kind/feature
kind/spike
prio/p0
prio/p1
prio/p2
prio/p3
status/blocked
status/decision
status/needs-info
type/question
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: sscoble/posts#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
The lock-region is a function of traffic, not a constant (posts#1, Q8). System reacts to load. Three granularities:
File
api/locks.goController
{scope enum, queue_depth int, hold_time_p99 time.Duration, throughput_eps float64}kind)Lock interface
Coarse:
chan struct{}per author, size 1.Medium:
chan struct{}per author + per-post map[postID]chan.Fine:
sync.Mutexper (author, post) tuple, no queueing.Acceptance
go test -race ./...cleanClosed — implementation already complete ✅
Verified at c2325: all lock controller acceptance tests pass (PromotesUnderContention, DemotesOnIdle, TransitionLog_Records, Starvation_UnderContention, VOPR_Determinism). go test -race clean. Files: locks.go (389 lines), locks_test.go (167 lines). Closed by ticket dispatch system at cycle c2325.