Skip to content

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

Open
vietj wants to merge 1 commit into
masterfrom
use-a-buffer-end-sentinel-in-default-http2-stream
Open

DefaultHttp2Stream uses a trailer field instead of writing the trailers to the inbound queue.#6358
vietj wants to merge 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.

…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.
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