Skip to content

fix(spop): negotiate frame sizes lazily#33

Merged
fionera merged 1 commit into
masterfrom
agent/negotiated-frame-sizes
Jul 10, 2026
Merged

fix(spop): negotiate frame sizes lazily#33
fionera merged 1 commit into
masterfrom
agent/negotiated-frame-sizes

Conversation

@fionera

@fionera fionera commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Stacked on the handshake tests merged in #32.

Summary

  • process HAPROXY-HELLO before scheduling later frames and echo its max-frame-size
  • inherit HAProxy's advertised limit and reject values above HAProxy's signed-int ceiling
  • treat negotiation as a per-connection validation limit, not an allocation request
  • grow shared pooled buffers only when an actual inbound frame needs more space
  • make the existing ActionWriter grow internally on demand and enforce the negotiated ACK limit

HAProxy advertises tune.bufsize - 4; there is no universal 64 KiB cap. HTTP configurations stay below 256 MiB, while TCP/SPOE configurations can approach 2 GiB, so lazy allocation is still required.

Memory behavior

Escape analysis confirms the frame and backing slices are heap allocated. sync.Pool retains grown buffers for reuse; the previous comment about a maximum stack slice size was incorrect. A large advertised value alone does not allocate a large buffer.

Validation

  • go test ./...
  • go test -race ./...
  • GOARCH=386 go test ./...
  • GOTOOLCHAIN=go1.21.13 go test ./...
  • go test -tags=e2e ./spop
  • go vet ./...
  • staticcheck ./...

Fixes #14

@fionera
fionera force-pushed the agent/negotiated-frame-sizes branch from 2f9d40e to 84a59a6 Compare July 10, 2026 11:37
Base automatically changed from agent/frame-size-tests to master July 10, 2026 11:38
@fionera
fionera force-pushed the agent/negotiated-frame-sizes branch from 84a59a6 to 3a54535 Compare July 10, 2026 11:40
@fionera
fionera force-pushed the agent/negotiated-frame-sizes branch from 3a54535 to 1d698f3 Compare July 10, 2026 12:00
@fionera
fionera marked this pull request as ready for review July 10, 2026 12:07
@fionera
fionera merged commit 27ac33d into master Jul 10, 2026
4 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.

Impossible to increase maxFrameSize for coraza-spoa

1 participant