Skip to content

HTTP2: Race in processing trailing headers #30238

@geoffkizer

Description

@geoffkizer

For HTTP2, we are processing trailing headers in Http2Stream.OnResponseHeader. This is called when we receive a HEADERS frame. We directly add any trailing headers to the associated HttpResponseMessage's TrailingHeaders collection. This means we're modifying the TrailingHeaders collection while another thread may be examining it.

In #28547, we agreed that trailing headers would not be added to the TrailingHeaders collection until the user reads to the end of the response stream. This avoids the race and makes TrailingHeaders availability deterministic. This is indeed how HTTP/1.1 works; however we unfortunately did not do this for HTTP2.

Metadata

Metadata

Assignees

Labels

bugtenet-reliabilityReliability/stability related issue (stress, load problems, etc.)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions