[go: up one dir, main page]

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

Make DeadlineConn http.Listener compatible #20635

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

klauspost
Copy link
Contributor

Description

http likes to slap an infinite read deadline on a connection and doing a blocking read while the response is being written.

This effectively means that a read deadline becomes the request response deadline.

Instead of enforcing our own timeout, we pass it through and keep "infinite deadline" sticky on connections.

We do however still "record" when reads are aborted, so we never overwrite that.

For the deadline to be effective, the http server should have ReadTimeout and IdleTimeout set.

How to test this PR?

Change

return result.conn, result.err
to

return deadlineconn.New(result.conn).WithReadDeadline(time.Minute), result.err

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

http likes to slap an infinite read deadline on a connection and doing a blocking read while the response is being written.

This effectively means that a read deadline becomes the request response deadline.

Instead of enforcing our own timeout, we pass it through and keep "infinite deadline" sticky on connections.

We do however still "record" when reads are aborted, so we never overwrite that.

For the deadline to be effective, the http server should have `ReadTimeout` and `IdleTimeout` set.
@harshavardhana harshavardhana merged commit b517799 into minio:master Nov 12, 2024
21 checks passed
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.

3 participants