Repository navigation
Measure unconsumed HTTP line bytes at the buffer boundary - #2
Merged
Merged
Conversation
This was referenced Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Measure unconsumed HTTP line bytes at the buffer boundary
Summary
Accept a complete request line or header field whose wire representation,
including CRLF, exactly fills the configured read buffer. Continue to reject an
incomplete line that fills the buffer with 414 or 431.
The parser currently checks
buf/limit, which describes the size of the wholeread view rather than the bytes the current parser state has not consumed. When
an exactly-full line is parsed, its terminating CRLF advances the position to
the limit and the parser enters its next state with zero remaining bytes. That
next state sees the historical full limit and incorrectly reports 431.
Both line-size predicates now check
buf/remaining:remaining == capacityand is rejected immediately.Boundary contract
With
:read-buffer-size 1024:The deterministic controls construct those exact wire lengths. Accepted
HTTP/1.1 controls request
Connection: close, so their client helper does notmistake a valid persistent connection for a stalled response.
The Hegel property now classifies the selected request or header line rather
than the total multi-line request. It generates both URI and header cases across
the boundary, records both line and total request lengths, and keeps the +1
negative controls non-vacuous.
Red to green evidence
Published base:
casselc/jolt-http@dcb3016fd2af289ce2cea23db6dc4b90d22c3f10Test-only commit:
ccb79365a5804cff388e6e2805e2c447327f9e12On stock Jolt/Jolt-HTTP before the two predicate changes, the full suite exits
1 with exactly the two expected boundary failures:
Fix commit:
ece1d5ef0709712295b64fc8fcf57c85c7438184The eight real-loopback Hegel properties also pass, including 25 generated
line-boundary cases.
Transport control
An earlier timing-dependent experiment suggested that an exactly-full line
might stall at the jolt-tcp boundary. A coordinated stock-TCP control disproved
that hypothesis: after the handler consumes a full view, read interest is
re-armed and an already-queued next byte is delivered. The apparent HTTP stall
was instead the accepted-case helper waiting for EOF on a keep-alive response.
No transport change is needed by this patch.
Validation
dcb3016fd2af289ce2cea23db6dc4b90d22c3f10ece1d5ef0709712295b64fc8fcf57c85c7438184jolt -M:test— PASS,342 checks, 0 failures
6 checks, 0 failures
Provenance
The oracle failure, production companion, corrected transport hypothesis, and
stock red/green evidence are tracked in
chucklehead-dev/jolt-aspect-packs#97.
The rejected transport hypothesis and its deterministic control are recorded in
chucklehead-dev/jolt-aspect-packs#98.
Those issues are provenance only; the tests and fix run on the stock published
libraries without aspect instrumentation.
Scope
The production change replaces
buf/limitwithbuf/remainingin the requestline and header-field incomplete-input guards. The rest of the branch is
deterministic acceptance and Hegel oracle coverage. It changes no buffer size,
aggregate-header limit, TCP readiness behavior, or public API.