-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Move gRPC driver to a subpackage and add an HTTP driver #1420
Conversation
6d4d41d
to
5ea0611
Compare
Codecov Report
@@ Coverage Diff @@
## master #1420 +/- ##
========================================
+ Coverage 78.6% 78.8% +0.1%
========================================
Files 126 131 +5
Lines 6375 6753 +378
========================================
+ Hits 5017 5326 +309
- Misses 1114 1167 +53
- Partials 244 260 +16
|
fallthrough | ||
case http.StatusServiceUnavailable: | ||
select { | ||
case <-time.After(getWaitDuration(d.cfg.backoff, i)): |
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.
Should this respect the Retry-After
header in addition to performing exponential backoff?
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.
Yeah, it should, but I decided to punt that to some follow-up PR.
5ea0611
to
5349a01
Compare
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 mostly skipped over the gRPC move, somewhat wishing the gRPC move and the new HTTP driver were in separate PRs, but wouldn't wish you to redo it either.
6bab96b
to
5f5f949
Compare
This is what the specification says for both gRPC and HTTP.
Currently it supports only binary protobuf payloads.
It also adds some common code mock collectors can use. This will be useful for testing the HTTP driver.
It also extends the one record checkpointer a bit. This will be useful for testing the HTTP driver.
We create our own instance of the transport, which is based on golang's DefaultTransport. That way we sidestep the issue of the DefaultTransport being modified/overwritten. We won't have any panics at init. The cost of it is to keep the transport fields in sync with DefaultTransport.
This may help with connection reuse.
5f5f949
to
93e8c25
Compare
Updated. Rebased to current master and fixed conflicts in changelog. |
93e8c25
to
9f96b91
Compare
This PR can be quite large, because I moved a bunch of code from one place to another. So maybe reviewing this PR will be more manageable if done commit-by-commit. If it's still too large then I suppose I can split the PR into three smaller ones like:
Please let me know.
Anyway, the new HTTP driver supports only binary protobuf payloads. The support for JSON format would be a follow-up PR to this one.