-
Notifications
You must be signed in to change notification settings - Fork 32
router, backend: retry connecting to different backends #171
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
Conversation
xhebox
left a comment
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.
Rest LGTM
|
|
||
| // In case of testing, backendIO is passed manually that we don't want to bother with the routing logic. | ||
| backendIO, err := getBackendIO(auth, auth, resp) | ||
| backendIO, err := getBackendIO(auth, auth, resp, 5*time.Second) |
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.
There is a constant, DialTimeout in backend_conn.go.
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.
It's different. The one passed to getBackendIO is the total timeout for all retries.
BTW, DialTimeout is also 5 seconds. Maybe it should be less?
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.
I think both.I think that DialTimeout should be less, but backoff duration should be larger, e.g. three or four times of DialTimeout.
What problem does this PR solve?
Issue Number: ref #168
Problem Summary:
To adapt to the serverless tier, retry connecting to different backends one by one.
Note that this PR has not adapted to the dedicated tier yet.
What is changed and how it works:
Router.Route()returnsBackendSelectornow, which returns a backend each time for callingNext().BackendConnMgrtries connecting to the backends at max 5 seconds.Check List
Tests
Notable changes
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.