Merge pull request #2369 from dmcgowan/update-grpc

Update grpc to 1.12
This commit is contained in:
Michael Crosby
2018-05-30 11:07:10 -04:00
committed by GitHub
71 changed files with 11243 additions and 5006 deletions

View File

@@ -20,7 +20,6 @@ import (
gocontext "context"
"fmt"
"io/ioutil"
golog "log"
"net"
"os"
"os/signal"
@@ -50,7 +49,7 @@ high performance container runtime
func init() {
// Discard grpc logs so that they don't mess with our stdio
grpclog.SetLogger(golog.New(ioutil.Discard, "", golog.LstdFlags))
grpclog.SetLoggerV2(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, ioutil.Discard))
cli.VersionPrinter = func(c *cli.Context) {
fmt.Println(c.App.Name, version.Package, c.App.Version, version.Revision)

View File

@@ -95,12 +95,13 @@ func connect(address string, d func(string, time.Duration) (net.Conn, error)) (*
gopts := []grpc.DialOption{
grpc.WithBlock(),
grpc.WithInsecure(),
grpc.WithTimeout(60 * time.Second),
grpc.WithDialer(d),
grpc.FailOnNonTempDialError(true),
grpc.WithBackoffMaxDelay(3 * time.Second),
}
conn, err := grpc.Dial(dialer.DialAddress(address), gopts...)
ctx, cancel := gocontext.WithTimeout(gocontext.Background(), 60*time.Second)
defer cancel()
conn, err := grpc.DialContext(ctx, dialer.DialAddress(address), gopts...)
if err != nil {
return nil, errors.Wrapf(err, "failed to dial %q", address)
}