Skip to content

Accept HTTP/2 PRIORITY_UPDATE frames for idle and closed streams - #1272

Open
arturobernalg wants to merge 1 commit into
apache:mainfrom
arturobernalg:h2-priority-update-idle
Open

arturobernalg wants to merge 1 commit into
apache:mainfrom
arturobernalg:h2-priority-update-idle

Conversation

@arturobernalg

@arturobernalg arturobernalg commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Tomcat drops the whole connection (GOAWAY with PROTOCOL_ERROR) when a client sends a PRIORITY_UPDATE for a stream it hasn't opened yet, or for one that was already closed and pruned.

RFC 9218 explicitly allows the first case. Section 7 says a client MAY send PRIORITY_UPDATE before the stream is open, and the server SHOULD keep it and apply it once the stream opens. For closed streams, section 7.1 says the server can just discard the frame.

It's easy to reproduce over h2c. Send the preface, a PRIORITY_UPDATE for stream 1, then HEADERS for stream 1, and you get a GOAWAY instead of the response.

With this change, the priority for an idle stream is kept and applied once the request headers are in, so it wins over a priority header, as section 7 suggests. Frames for closed streams are ignored. The two errors section 7.1 does require are still there: a PRIORITY_UPDATE for an idle push stream, and going over SETTINGS_MAX_CONCURRENT_STREAMS with idle plus active streams.

Tests are added to TestRfc9218.

RFC 9218, section 7 allows a client to send a PRIORITY_UPDATE frame
before the stream it references is opened, and servers SHOULD retain it
and apply it once the stream is opened. Section 7.1 allows servers to
discard frames for closed streams. A PRIORITY_UPDATE frame for a stream
that was not in the stream map, whether idle or closed and pruned, was
treated as a connection error.

Retain the priority for an idle request stream and apply it once the
request header fields have been processed so that it overrides any
priority header field. Ignore frames for closed streams. Keep the
connection errors required by section 7.1 for an idle push stream and
when the prioritized idle streams plus the active streams would exceed
the maximum number of concurrent streams.
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.

1 participant