* Extracted the opentracing wrapper to it's own file
* Commented all the public methods
* gofmt/goimports
* Made sure the two interceptor builders are similar
Signed-off-by: Andres Taylor <antaylor@squareup.com>
Before this change, the GRPC server could get started before tracing
had been initiated, which meant that the GRPC interceptors were not
hooked up properly.
Signed-off-by: Andres Taylor <antaylor@squareup.com>
Make sure to send span information when doing grpc call,
and retrieving span information when running a grpc server.
Signed-off-by: Andres Taylor <antaylor@squareup.com>
Note: This is the revert of a temporary revert and has the same effect
as the original PR: https://github.com/vitessio/vitess/pull/3830
Revert "Revert "Factor out glog references""
This reverts commit 246e2898d2.
Signed-off-by: David Weitzman <dweitzman@pinterest.com>
Use by passing the flag "-grpc_compression=snappy" to any client side
binary. If the server doesn't support snappy compression it will ignore
the client side request.
Signed-off-by: Jon Tirsen <jontirsen@squareup.com>
This commit consists only of the changes from running the following:
```
find go -name '*.go' | xargs -n 10 -- sed -i -r -e \
's,"github.com/youtube/vitess/go/,"vitess.io/vitess/go/,'
```
* This commit adds an interface to implement auth plugin
in Vitess grpc server
* It also implements an static plugin that allows client/server
to authentic using basic auth.
Issues #3401, #3412
Now that we always dial asynchronously, we have to make sure that
requests don't fail fast. Otherwise, we sometimes see errors if
request is made immediately after dialing; Because the connection
is not ready yet.
Consequently, dial timeouts are obsolete. So, I've removed all
usage of it.
The default retry delay of 2ms was essentially causing a tight
loop and a lot of spam due to the grpc retries. This is causing
increased flakyness of travis tests.
Changed the retry to back-off exponentially unless we get
responses, at which point it will reset.
Also added a custom logger for grpc that suppresses the spammy
info log.
grpc is moving towards error-less dialing. Failures can happen
only during requests. However, all requests currently fail with
'Unavailable' error due to a design constraint. There is currently
no way to programmatically get to the underlying error.
Due to this, we have to rely on grpc's logging to find the root
cause of failures. This is now turned on for all programs that
use the grpc client.
For now, I'm leaving the dial timeout parameters in. They'll just
be ignored. Once we're confident that this approach works, we
can clean them all up.
Issues #3291, #3211, #3194
It turns out that the default grpc settings almost always make it return
a 'deadline exceeded' error no matter what the failure is.
I've now added a new flag: FailOnNonTempDialError, which fails faster
on chronic errors and returns a better error message along with the
address, etc. This should address most of the issues that were reporting
that error messages that were too vague.
Issue #3293
* Created a new grpcclient package that always uses the
specified grpc_max_message_size option. Changed all grpc
dials to use grpcclient.
* Renamed grpcutils->grpccommon. It defines grpc_max_message_size.
* Changed servenv to use grpccommon.
* Moved all flag initializations to init functions. Otherwise, repeat
of common flag initialzations can cause crashes.
Going forward, server-only flags should go to servenv, client-only
flags should go to grpcclient, and flags common to both should go
to grpccommon.