Repository navigation
Conversation
This branch has not been deployed
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.
Successful JSON, query, and form extraction currently pays for field-path tracking. Deserialize without tracking first, then retry over the same buffered input with
serde_path_to_erroronly on failure. This follows tokio-rs/axum#3924 (commit 853067671a38632ceab12cc6227c046152db779c).JSON keeps its current trailing-input behavior; this does not add an end-of-input check. Body limits, content-type checks, parser choice, and detailed error mapping remain unchanged. The deser-based extractors are unchanged.
Custom deserializers can run twice, repeat side effects, or produce a different result. A successful retry is accepted. The extractor docs state this behavior, and a test covers a stateful deserializer that succeeds on retry.
Local benchmark results
Eight alternating paired rounds, each with 1 s warmup and 1 s measurement; release builds with the same compiler and lockfile. Rust 1.100.0-beta.7 on macOS. No CodSpeed or sockets.
Payload:
{ n: u32, s: String, b: bool }. Early and late failures are invalid values in the first and last fields of a small payload. Query measuresfrom_query; JSON/form include request construction, buffering, and extraction. All cases check the result; errors are formatted. These are not full HTTP throughput measurements, and absolute times are not comparable across extractor types.The result is a success/failure tradeoff: valid inputs improve; invalid inputs cost more. Bootstrap intervals describe this local session. Compiler layout and machine noise remain possible. The tested baseline is 5d2189d and predates current upstream main; the results are not from a refreshed upstream build. Existing unrelated russe edits were identical in both benchmark builds and are excluded from this PR.
Method and reproduction steps · Raw samples · Summary
Validation
cargo test -p actix-web-lab --lib --test extractor_error_paths --locked --quiet: 147 unit tests and 4 integration tests passed.just clippy: workspace, all targets, all features; passed without warnings.Regression coverage includes diagnostic paths/messages, JSON error classification, existing body limits, trailing JSON, and successful retry of a custom deserializer.