-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Sane default and configurable Marathon request timeouts #3286
Sane default and configurable Marathon request timeouts #3286
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely worthwhile.
Two questions:
- Do we need to make the timeouts configurable? That is, could there be users that whose workflow breaks with the new, more strict timeouts?
- Should this PR go into the release branch as a regular bugfix? Personally I'd say so iff the answer to the first question is "no".
|
Sounds reasonable on both fronts. 👍 |
f1f6db5
to
c8f7ccd
Compare
I updated the PR accordingly. PTAL. |
provider/marathon/marathon.go
Outdated
@@ -55,7 +55,9 @@ type Provider struct { | |||
MarathonLBCompatibility bool `description:"Add compatibility with marathon-lb labels" export:"true"` | |||
FilterMarathonConstraints bool `description:"Enable use of Marathon constraints in constraint filtering" export:"true"` | |||
TLS *types.ClientTLS `description:"Enable TLS support" export:"true"` | |||
DialerTimeout flaeg.Duration `description:"Set a non-default connection timeout for Marathon" export:"true"` | |||
DialerTimeout flaeg.Duration `description:"Set a non-default dialer timeout for Marathon" export:"true"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to use the phrase "non-default"? Isn't it kind of assumed that defaults will be used unless specified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, thanks! I removed the "non-default".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
A dial timeout of 60 seconds is overly excessive for a DNS request and probably as good as no timeout at all. Therefore, I changed the default value to 5 seconds as this is more reasonable.
The new timeout values are matching the one that go-marathon would set by itself for the default HTTP client that it uses for SSE subscriptions.
e0b2db3
to
86e865f
Compare
What does this PR do?
Set sane timeouts for requests to Marathon and make them configurable.
Motivation
Before the timeouts were either overly excessive or not existent at all. For requests done by go-marathon there was no timeout, which means when there was temporarily a network problem which doesn't immediately show a failure (e.g. when the packets are dropped by a firewall) Traefik will never be able to create a connection to Marathon, as this one request will be running basically forever. I used the same timeouts as go-marathon does by default. We have to do this in Traefik as we pass in our own http.Client.
More