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

add configurable idle timeout #2632

Merged
merged 3 commits into from
Jul 7, 2020

Conversation

skriss
Copy link
Member

@skriss skriss commented Jun 26, 2020

updates #2225

I started with just one timeout setting chosen at random; I'll add the others if the approach looks OK.

I can see how adding additional tuneables one-by-one is not ideal (+268 LOC to add a single config parameter). I'm still paging in the context to see if there are other ideas/options for how to do this in a more general way.

@codecov
Copy link

codecov bot commented Jun 26, 2020

Codecov Report

Merging #2632 into master will increase coverage by 0.00%.
The diff coverage is 46.15%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2632   +/-   ##
=======================================
  Coverage   76.92%   76.93%           
=======================================
  Files          71       71           
  Lines        5591     5605   +14     
=======================================
+ Hits         4301     4312   +11     
- Misses       1203     1205    +2     
- Partials       87       88    +1     
Impacted Files Coverage Δ
cmd/contour/serve.go 0.00% <0.00%> (ø)
internal/contour/listener.go 92.74% <71.42%> (-0.81%) ⬇️
cmd/contour/servecontext.go 93.44% <100.00%> (+0.16%) ⬆️
internal/envoy/listener.go 97.60% <100.00%> (+0.02%) ⬆️

Copy link
Member

@youngnick youngnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice work. I agree that we need to keep an eye on how much code handling all these timeouts adds, but better to keep adding them and you can come up with a plan as you do them.

@skriss skriss changed the title [WIP] add configurable idle timeout add configurable idle timeout Jul 6, 2020
@skriss skriss marked this pull request as ready for review July 6, 2020 18:41
@skriss skriss added release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. labels Jul 6, 2020
Comment on lines 241 to 244
// IdleTimeout defines how long the proxy should wait while there
// are no active requests before terminating an HTTP connection. Set
// to 0 to disable the timeout.
IdleTimeout time.Duration `yaml:"idle-timeout,omitempty"`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@youngnick @jpeach @stevesloka before merging this, I'm considering renaming this field and related code to ConnectionIdleTimeout to more explicitly differentiate from StreamIdleTimeout which I'm adding next. What do you all prefer? IdleTimeout and StreamIdleTimeout, or ConnectionIdleTimeout and StreamIdleTimeout?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Envoy has separate stream and connection timeouts, so we should name this for whichever Envoy timeout it refers to. This helps a lot.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is the connection idle timeout, but envoy just calls it "idle_timeout".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave this as-is so I can move ahead, but can always circle back if desired.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ConnectionIdleTimeout & StreamIdleTimeout like you suggested is good. It helps to better clarify the context a bit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK @stevesloka I updated the name, mind taking a quick look before I merge?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is the connection idle timeout, but envoy just calls it "idle_timeout".

Right. The doc I linked to explains that this is an alias to the stream timeout.

Signed-off-by: Steve Kriss <krisss@vmware.com>
Signed-off-by: Steve Kriss <krisss@vmware.com>
Signed-off-by: Steve Kriss <krisss@vmware.com>
Copy link
Member

@stevesloka stevesloka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@stevesloka stevesloka merged commit bd79b57 into projectcontour:master Jul 7, 2020
@skriss skriss deleted the add-idle-timeout branch July 7, 2020 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants