Skip to content

net/http: add http1 and http2 Server IdleTimeout #14204

Closed
@bradfitz

Description

@bradfitz

Add http.Server.IdleTimeout to limit the keep-alive idle time for http1 and http2 servers.

Activity

self-assigned this
on Feb 2, 2016
added this to the Go1.7 milestone on Feb 2, 2016
gopherbot

gopherbot commented on Feb 3, 2016

@gopherbot
Contributor

CL https://golang.org/cl/19159 mentions this issue.

odeke-em

odeke-em commented on Apr 4, 2016

@odeke-em
Member

If I may ask, this is going to entail us adding MaxIdleTimeout and MaxActiveTimeout to Server, right? And also we'll add defaults as you in have in CL 19159, true?
Or should we just expose a new function IdleTimeoutHook so that it takes these durations which if <= 0 means we should use the default durations?

gopherbot

gopherbot commented on Apr 4, 2016

@gopherbot
Contributor

CL https://golang.org/cl/21491 mentions this issue.

added
FeatureRequestIssues asking for a new feature that does not need a proposal.
on May 10, 2016
modified the milestones: Go1.8, Go1.7 on May 18, 2016
bradfitz

bradfitz commented on Sep 1, 2016

@bradfitz
ContributorAuthor

@odeke-em, the naming here is much easier if we don't consider HTTP/2 and PING frames as activity. Then we'd just call it IdleTimeout and be done with it.

But with HTTP/2, do we care about clients sending a PING or other useless frame every N seconds vs. actually sending real requests every N seconds? If so, we need names for both types of idle (network idle vs no-HTTP-requests idle). Or we define IdleTimeout to mean one thing, and give ReadTimeout the other meaning (see #16958 (comment))?

Opinions welcome. Ideally with sample documentation you'd tell users.

I got as far as:

        // ReadTimeout optionally specifies a maximum duration before                                                                                        
        // timing out reads of request headers. It does not include                                                                                          
        // request bodies. For requests after the first on a                                                                                                 
        // connection, this is timer starts upon receiving the first                                                                                         
        // byte. For keep-alive duration, see IdleTimeout.                                                                                                   
        ReadTimeout  time.Duration

        // IdleTime, is, uh....                                                                                                                              
        IdleTimeout time.Duration

/cc @rhysh @broady @adg @bmizerany

bradfitz

bradfitz commented on Sep 1, 2016

@bradfitz
ContributorAuthor

/cc @prabrisat1 too.

24 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @freeformz@bradfitz@rsc@quentinmit@odeke-em

        Issue actions

          net/http: add http1 and http2 Server IdleTimeout · Issue #14204 · golang/go