Remove stray HTTP/2 machine timeout messages on terminate#161
Open
smartinio wants to merge 2 commits into
Open
Remove stray HTTP/2 machine timeout messages on terminate#161smartinio wants to merge 2 commits into
smartinio wants to merge 2 commits into
Conversation
Member
|
Thanks now CI should run. |
Author
|
Hi @essen, is anything blocking this from getting merged? |
Member
|
Just time. I need to double check things. I'll see if I can do it for this month's release. |
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.
What
cow_http2_machine:terminate/1removing stray HTTP/2 machine timeout messagesterminate/1to synchronously cancel and removepreface_timeoutandsettings_timeoutmessages, using the same pattern as Cowboy: https://github.com/ninenines/cowboy/blob/d386b0f62ddb57fee7d489b875239a812202956c/src/cowboy_http.erl#L348-L361Why
cow_http2_machinestarts timers that send{timeout, TRef, _}messages to the owning process.terminate/1cancels these timers asynchronously and does not remove stray timeout messages from the mailbox. This sometimes leaves stale HTTP/2 machine timeout messages for the caller to receive after the machine has terminated.This manifests in Gun as an error:
Unexpected event in state :domain_lookup of type :info:. Here's a repro using Gun. Target the ebin of this fixed cowlib version vs latest usingCOWLIB_EBIN:Details
Testing
Tests cover
terminate/1removing straypreface_timeoutandsettings_timeoutmessages.