Skip to content

Enforce MaxPendingRequestsPerIP as a hard cap#186

Merged
linkdata merged 2 commits into
mainfrom
fix/174-strict-pending-cap
Jul 20, 2026
Merged

Enforce MaxPendingRequestsPerIP as a hard cap#186
linkdata merged 2 commits into
mainfrom
fix/174-strict-pending-cap

Conversation

@linkdata

Copy link
Copy Markdown
Owner

Summary

  • keep preferring the oldest idle pending request as the eviction victim
  • retire the oldest pending request when every candidate is fresh, making the positive per-IP limit a hard cap
  • document the all-fresh admission policy and update MarkWritten's contract
  • replace the overshoot expectations and cover fresh-render ownership plus concurrent same-IP creation

Testing

  • go generate ./...
  • go vet ./...
  • gofmt -l .
  • gofumpt -l requestpool.go request.go jaws_test.go
  • staticcheck ./...
  • golangci-lint run
  • gosec ./...
  • go build ./...
  • JAWS_REQUIRE_NODE=1 go test -race -coverprofile=coverage.out ./... (core package: 100.0%)

Closes #174

linkdata added 2 commits July 20, 2026 17:24
When every pending request for an IP is fresh, retire the least recently
written one instead of the oldest-created one, and guard the eviction
loop against spinning under jw.mu if retirement ever declines a victim.
@linkdata
linkdata marked this pull request as ready for review July 20, 2026 15:46
@linkdata
linkdata merged commit fab336b into main Jul 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MaxPendingRequestsPerIP can exceed its documented maximum

1 participant