Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http2: allow streams to complete gracefully after goaway #50202

Merged

Commits on Oct 16, 2023

  1. http2: allow streams to complete gracefully after goaway

    A detailed analysis of the cause of this bug is in my linked comment on
    the corresponding issue. The primary fix is the new setImmediate call in
    Http2Stream#_destroy, which prevents a re-entrant call into
    Http2Session::SendPendingData when sending trailers after the
    Http2Session has been shut down, allowing the trailer data to be flushed
    properly before the socket is closed.
    
    As a result of this change, writes can be initiated later in the
    lifetime of the Http2Session. So, when a JSStreamSocket is used as the
    underlying socket reference for an Http2Session, it needs to be able to
    accept write calls after it is closed.
    
    In addition, now that outgoing data can be flushed differently after a
    session is closed, in two tests clients receive errors that they
    previously did not receive. I believe the new errors are more correct,
    so I changed the tests to match.
    
    Fixes: nodejs#42713
    Refs: nodejs#42713 (comment)
    murgatroid99 committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    b422491 View commit details
    Browse the repository at this point in the history