Skip to content

test(mint): cover incoming stream-level errors in process_response - #566

Merged
sleipnir merged 2 commits into
elixir-grpc:masterfrom
freevova:test/cover-incoming-stream-errors
Jul 27, 2026
Merged

test(mint): cover incoming stream-level errors in process_response#566
sleipnir merged 2 commits into
elixir-grpc:masterfrom
freevova:test/cover-incoming-stream-errors

Conversation

@freevova

Copy link
Copy Markdown
Contributor

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_response to 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 the process_response error clause from #559 makes the test fail with the original FunctionClauseError.

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.

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
sleipnir merged commit 4fb3e2d into elixir-grpc:master Jul 27, 2026
7 checks passed
@sleipnir

Copy link
Copy Markdown
Collaborator

Thank you @freevova

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.

2 participants