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

proposal: x/net/http2: per-write timeouts (WriteByteTimeout) for servers #67811

Closed
neild opened this issue Jun 4, 2024 · 3 comments
Closed
Labels
Milestone

Comments

@neild
Copy link
Contributor

neild commented Jun 4, 2024

This issue is part of a project to move x/net/http2 into std: #67810

HTTP/2 transports have a Transport.WriteByteTimeout configuration setting, which sets the maximum time a single write to a connection may take. The timeout begins when a write is made, and is extended whenever any data is written.

This setting can be used to detect unresponsive connections when the timeout for an entire request may be large or unbounded.

I propose extending this feature to apply to HTTP/2 server connections as well.

package http2

type Server struct { // contains unchanged fields
	// WriteByteTimeout is the timeout after which a connection will be
	// closed if no data can be written to it. The timeout begins when data is
	// available to write, and is extended whenever any bytes are written.
	WriteByteTimeout time.Duration
}

Adding this feature removes an inconsistency between HTTP/2 client and server configurations. Aligning the two will make it easier to add support for configuring HTTP/2 features to net/http, since we can define a single configuration struct rather than separate ones for clients and servers.

@rsc
Copy link
Contributor

rsc commented Jun 11, 2024

Is this different from #61777?

@neild
Copy link
Contributor Author

neild commented Jun 11, 2024

Nope, just entirely forgot I'd filed that one.

@neild
Copy link
Contributor Author

neild commented Jun 11, 2024

Duplicate of #61777

@neild neild marked this as a duplicate of #61777 Jun 11, 2024
@neild neild closed this as completed Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Incoming
Development

No branches or pull requests

3 participants