Skip to content

DefaultHttp2Stream uses a trailer field instead of writing the trailers to the inbound queue. - #6358

Merged
vietj merged 1 commit into
masterfrom
use-a-buffer-end-sentinel-in-default-http2-stream
Sep 14, 2026
Merged

vietj merged 1 commit into
masterfrom
use-a-buffer-end-sentinel-in-default-http2-stream

Conversation

@vietj

@vietj vietj commented Sep 11, 2026

Copy link
Copy Markdown
Member

Motivation:

DefaultHttp2Stream uses an inbound queue and write the trailers as last message / sentinel.

As consequence the inbound queue type parameter is object, while it mostly contains buffers.

We can use an sentinel buffer to signal the end of the stream and write the trailers as a field.

The context will read the trailers field correctly using the happens-before relationship provided by the inbound message queue write/read.

Changes:

Write the trailers to a trailers field when notified by the stream inbound trailers, then write the end of stream last message.

Read the trailers field after receiving the end of stream last message.

@vietj
vietj force-pushed the use-a-buffer-end-sentinel-in-default-http2-stream branch from 9f48953 to 9d19000 Compare September 14, 2026 09:01
@vietj vietj added this to the 5.2.0 milestone Sep 14, 2026
@vietj vietj self-assigned this Sep 14, 2026
…rs to the inbound queue.

Motivation:

DefaultHttp2Stream uses an inbound queue and write the trailers as last message / sentinel.

As consequence the inbound queue type parameter is object, while it mostly contains buffers.

We can use an sentinel buffer to signal the end of the stream and write the trailers as a field.

The context will read the trailers field correctly using the happens-before relationship provided by the inbound message queue write/read.

Changes:

Write the trailers to a trailers field when notified by the stream inbound trailers, then write the end of stream last message.

Read the trailers field after receiving the end of stream last message.
@vietj
vietj force-pushed the use-a-buffer-end-sentinel-in-default-http2-stream branch from 9d19000 to 781e1b0 Compare September 14, 2026 09:30
@vietj
vietj merged commit c35d5bb into master Sep 14, 2026
8 checks passed
@vietj
vietj deleted the use-a-buffer-end-sentinel-in-default-http2-stream branch September 14, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant