test(mint): cover incoming stream-level errors in process_response - #566
Merged
sleipnir merged 2 commits intoJul 27, 2026
Merged
Conversation
Injects a raw RST_STREAM(REFUSED_STREAM) frame for an in-flight request as
if it arrived on the socket — the same {:error, ref, %Mint.HTTPError{}}
response-entry shape that GOAWAY produces for requests it races. Runs
against a bare TCP server that only completes the HTTP/2 preface and then
stays silent, so no real server frames race the injected one.
Guards the fix from elixir-grpc#559: removing the process_response error clause makes
this test fail with the original FunctionClauseError.
sleipnir
approved these changes
Jul 27, 2026
Collaborator
|
Thank you @freevova |
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.
Follow-up to #562, replacing it (opened from a personal fork this time — the previous branch lived in an organization-owned fork, where GitHub doesn't offer "allow edits from maintainers" at all, and was also cut from the v1.0.2 tag, which dragged unrelated commits into the diff).
While rebasing onto master I found the crash itself is already fixed there by #559 — including the unknown-ref guard, which also covers a second production crash variant we'd hit (the connection process dying on
consume_responseto an already-dead stream response process). So what's left of the original PR is the regression test, adapted to master.The test injects a raw RST_STREAM(REFUSED_STREAM) frame for an in-flight request as if it arrived on the socket — the same
{:error, ref, %Mint.HTTPError{}}response-entry shape that GOAWAY produces for requests it races. It runs against a bare TCP server that only completes the HTTP/2 preface and then stays silent, so no real server frames race the injected one. Removing theprocess_responseerror clause from #559 makes the test fail with the originalFunctionClauseError.One ask: could you cut a release? hex 1.0.2 crashes in production under routine ingress GOAWAYs (several times per hour for us), so we're running a pinned fork until a release with #559 is out.