Repository navigation
Make graceful close, servecontent, and HTTP/2 error responses trim-safe - #1399
Merged
Merged
Conversation
HTTP/2 connections stored their shutdown notification as a closure in a Function-typed field, so close(server) in a juliac --trim build had an unresolved call. Store the HTTP/2 shutdown state in a concrete struct. The client/server trim workload now closes its server gracefully; the other workloads keep forceclose, which skipped this path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Response's body keyword defaulted to the nobody vector, so inference could
not fold the "no keyword body" check and every keyword-built response
gained a Response{Vector{UInt8}} type. servecontent also declared an
abstract ::Response return. Together, callers saw the abstract
HTTP.Response, and reading or writing its body was dynamically dispatched
under juliac --trim (a servecontent byte range in a natively built
server). Default the keyword to a private singleton and drop the
annotation: servecontent over bytes now infers three concrete response
types. An explicit body=HTTP.nobody keeps its meaning.
The file-server trim workload now reads a servecontent range body.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1399 +/- ##
=======================================
Coverage 90.80% 90.80%
=======================================
Files 31 31
Lines 12838 12841 +3
=======================================
+ Hits 11657 11660 +3
Misses 1181 1181 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Two places where a natively built (
juliac --trim=safe) server on HTTP.jl 2.9 hits dynamic dispatch. Both turned up while moving LeagueEasy onto registered HTTP.jl.Graceful
close(server)HTTP/2 connections stored their shutdown notification as a closure in a
Function-typed field. A trimmed app that calledclose(server)hit an unresolved call. HTTP's own trim workloads useforceclose, which skips this path, so the tests never caught it. The shutdown state is now a concrete struct. The client/server trim workload now closes its server gracefully.servecontentresponse typesResponse'sbodykeyword defaulted to thenobodyvector, so inference couldn't fold the "no keyword body" check. Every keyword-built response picked up an extraResponse{Vector{UInt8}}type.servecontentwas also annotated::Response.Together, callers saw the abstract
HTTP.Response, so reading or writing its body was dynamically dispatched. A natively built server failed to verify when serving a byte range.The keyword now defaults to a private singleton, and the annotation is gone.
servecontentover bytes now infers three concrete response types. An explicitbody=HTTP.nobodykeeps its meaning. The file-server trim workload now reads aservecontentrange body.HTTP/2 status responses
The HTTP/2 server built its 500 responses with a
request=keyword typed as a union of request types. A union-typed keyword makes the keyword call dynamically dispatched. Older inference happened to resolve these calls. On Julia 1.14-dev, after the body-keyword change, they became 4 verifier errors per server specialization. The request is now set after construction.Validation
Both binaries run.
Pkg.test()passes locally on Julia 1.13.1, including all 81 trim checks.Servo.httphandler, with buffered and streaming responses and a gracefulclose.ScopedValuesfix: 0 verifier errors, and the binary passes.ScopedValuesfindings.🤖 Generated with Claude Code