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

proxy: add idle timeout #2319

Merged
merged 7 commits into from
Jul 2, 2021
Merged

proxy: add idle timeout #2319

merged 7 commits into from
Jul 2, 2021

Conversation

wasaga
Copy link
Contributor

@wasaga wasaga commented Jun 29, 2021

Summary

Related issues

Fixes https://github.com/pomerium/internal/issues/445

Checklist

  • reference any related issues
  • updated docs
  • updated unit tests
  • updated UPGRADING.md
  • add appropriate tag (improvement / bug / etc)
  • ready for review

@wasaga wasaga requested a review from a team as a code owner June 29, 2021 22:02
@wasaga wasaga requested a review from calebdoxsey June 29, 2021 22:02
@codeclimate
Copy link

codeclimate bot commented Jun 29, 2021

Code Climate has analyzed commit 677f681 and detected 0 issues on this pull request.

View more on Code Climate.

@coveralls
Copy link

coveralls commented Jun 29, 2021

Coverage Status

Coverage decreased (-0.05%) to 64.654% when pulling 677f681 on wasaga/route-idle-timeout into 9bc5227 on master.

Copy link
Contributor

@desimone desimone left a comment

Choose a reason for hiding this comment

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

How do these policy timeout settings interact with the option timeouts?

pomerium/config/options.go

Lines 108 to 113 in 41a2622

// Timeout settings : https://github.com/pomerium/pomerium/issues/40
ReadTimeout time.Duration `mapstructure:"timeout_read" yaml:"timeout_read,omitempty"`
WriteTimeout time.Duration `mapstructure:"timeout_write" yaml:"timeout_write,omitempty"`
IdleTimeout time.Duration `mapstructure:"timeout_idle" yaml:"timeout_idle,omitempty"`

In particular, IdleTimeout?

It looks like WriteTimeout and ReadTimeout are no longer used as originally designed (as part of the old underlying net.Conn for proxy)?

internal/testutil/testutil.go Show resolved Hide resolved
config/envoyconfig/routes_test.go Outdated Show resolved Hide resolved
config/policy.go Outdated
@@ -188,7 +193,15 @@ type PolicyRedirect struct {

// NewPolicyFromProto creates a new Policy from a protobuf policy config route.
func NewPolicyFromProto(pb *configpb.Route) (*Policy, error) {
timeout, _ := ptypes.Duration(pb.GetTimeout())
var timeout, idleTimeout *time.Duration
Copy link
Contributor

@desimone desimone Jun 29, 2021

Choose a reason for hiding this comment

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

same declaration is seperated in ToProto. Personally I prefer splitting it, and keeping the variable close to the assignment as in ToProto but I think we should be consistent either way.

edit: removed nit. Let's be consistent.

config/policy.go Outdated Show resolved Hide resolved
config/policy.go Outdated Show resolved Hide resolved
docs/reference/settings.yaml Outdated Show resolved Hide resolved
Co-authored-by: bobby <1544881+desimone@users.noreply.github.com>
@wasaga
Copy link
Contributor Author

wasaga commented Jun 30, 2021

How do these policy timeout settings interact with the option timeouts?

my reading of https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto#envoy-v3-api-field-config-route-v3-routeaction-idle-timeout: per-route idle_timeout relates to HTTP2 stream while the one you're referring controls timeout for TCP HTTP2 connection as a whole.

read_timeout is mapped to request_timeout

and write_timeout is mapped to max_stream_duration but only if it's set - currently it defaults to zero which disables it.

wasaga and others added 2 commits June 29, 2021 23:45
Co-authored-by: bobby <1544881+desimone@users.noreply.github.com>
Co-authored-by: bobby <1544881+desimone@users.noreply.github.com>
@travisgroth travisgroth requested review from desimone and removed request for calebdoxsey June 30, 2021 19:20
@wasaga wasaga merged commit 134ca74 into master Jul 2, 2021
@wasaga wasaga deleted the wasaga/route-idle-timeout branch July 2, 2021 14:29
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.

None yet

3 participants