cmd/vendor: update grpc (upstream)

This commit is contained in:
Gyu-Ho Lee
2016-05-12 19:02:30 -07:00
parent f4d1501198
commit 711be0a567
6 changed files with 31 additions and 18 deletions

20
cmd/Godeps/Godeps.json generated
View File

@ -1,7 +1,7 @@
{ {
"ImportPath": "github.com/coreos/etcd", "ImportPath": "github.com/coreos/etcd",
"GoVersion": "go1.6", "GoVersion": "go1.6",
"GodepVersion": "v62", "GodepVersion": "v63",
"Packages": [ "Packages": [
"./..." "./..."
], ],
@ -209,39 +209,39 @@
}, },
{ {
"ImportPath": "google.golang.org/grpc", "ImportPath": "google.golang.org/grpc",
"Rev": "b062a3c003c22bfef58fa99d689e6a892b408f9d" "Rev": "15e50a43c679d14f4f83a83d3177864cfd751cdd"
}, },
{ {
"ImportPath": "google.golang.org/grpc/codes", "ImportPath": "google.golang.org/grpc/codes",
"Rev": "b062a3c003c22bfef58fa99d689e6a892b408f9d" "Rev": "15e50a43c679d14f4f83a83d3177864cfd751cdd"
}, },
{ {
"ImportPath": "google.golang.org/grpc/credentials", "ImportPath": "google.golang.org/grpc/credentials",
"Rev": "b062a3c003c22bfef58fa99d689e6a892b408f9d" "Rev": "15e50a43c679d14f4f83a83d3177864cfd751cdd"
}, },
{ {
"ImportPath": "google.golang.org/grpc/grpclog", "ImportPath": "google.golang.org/grpc/grpclog",
"Rev": "b062a3c003c22bfef58fa99d689e6a892b408f9d" "Rev": "15e50a43c679d14f4f83a83d3177864cfd751cdd"
}, },
{ {
"ImportPath": "google.golang.org/grpc/internal", "ImportPath": "google.golang.org/grpc/internal",
"Rev": "b062a3c003c22bfef58fa99d689e6a892b408f9d" "Rev": "15e50a43c679d14f4f83a83d3177864cfd751cdd"
}, },
{ {
"ImportPath": "google.golang.org/grpc/metadata", "ImportPath": "google.golang.org/grpc/metadata",
"Rev": "b062a3c003c22bfef58fa99d689e6a892b408f9d" "Rev": "15e50a43c679d14f4f83a83d3177864cfd751cdd"
}, },
{ {
"ImportPath": "google.golang.org/grpc/naming", "ImportPath": "google.golang.org/grpc/naming",
"Rev": "b062a3c003c22bfef58fa99d689e6a892b408f9d" "Rev": "15e50a43c679d14f4f83a83d3177864cfd751cdd"
}, },
{ {
"ImportPath": "google.golang.org/grpc/peer", "ImportPath": "google.golang.org/grpc/peer",
"Rev": "b062a3c003c22bfef58fa99d689e6a892b408f9d" "Rev": "15e50a43c679d14f4f83a83d3177864cfd751cdd"
}, },
{ {
"ImportPath": "google.golang.org/grpc/transport", "ImportPath": "google.golang.org/grpc/transport",
"Rev": "b062a3c003c22bfef58fa99d689e6a892b408f9d" "Rev": "15e50a43c679d14f4f83a83d3177864cfd751cdd"
}, },
{ {
"ImportPath": "gopkg.in/cheggaaa/pb.v1", "ImportPath": "gopkg.in/cheggaaa/pb.v1",

View File

@ -491,7 +491,10 @@ func (cc *Conn) resetTransport(closeTransport bool) error {
return ErrClientConnTimeout return ErrClientConnTimeout
} }
closeTransport = false closeTransport = false
time.Sleep(sleepTime) select {
case <-time.After(sleepTime):
case <-cc.shutdownChan:
}
retries++ retries++
grpclog.Printf("grpc: Conn.resetTransport failed to create client transport: %v; Reconnecting to %q", err, cc.target) grpclog.Printf("grpc: Conn.resetTransport failed to create client transport: %v; Reconnecting to %q", err, cc.target)
continue continue

View File

@ -284,14 +284,11 @@ func checkRecvPayload(pf payloadFormat, recvCompress string, dc Decompressor) er
switch pf { switch pf {
case compressionNone: case compressionNone:
case compressionMade: case compressionMade:
if recvCompress == "" {
return transport.StreamErrorf(codes.InvalidArgument, "grpc: invalid grpc-encoding %q with compression enabled", recvCompress)
}
if dc == nil || recvCompress != dc.Type() { if dc == nil || recvCompress != dc.Type() {
return transport.StreamErrorf(codes.InvalidArgument, "grpc: Decompressor is not installed for grpc-encoding %q", recvCompress) return transport.StreamErrorf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", recvCompress)
} }
default: default:
return transport.StreamErrorf(codes.InvalidArgument, "grpc: received unexpected payload format %d", pf) return transport.StreamErrorf(codes.Internal, "grpc: received unexpected payload format %d", pf)
} }
return nil return nil
} }

View File

@ -81,7 +81,7 @@ type Stream interface {
// ClientStream defines the interface a client stream has to satify. // ClientStream defines the interface a client stream has to satify.
type ClientStream interface { type ClientStream interface {
// Header returns the header metedata received from the server if there // Header returns the header metadata received from the server if there
// is any. It blocks if the metadata is not ready to read. // is any. It blocks if the metadata is not ready to read.
Header() (metadata.MD, error) Header() (metadata.MD, error)
// Trailer returns the trailer metadata from the server. It must be called // Trailer returns the trailer metadata from the server. It must be called

View File

@ -289,7 +289,10 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Strea
} }
} }
if _, err := wait(ctx, t.shutdownChan, t.writableChan); err != nil { if _, err := wait(ctx, t.shutdownChan, t.writableChan); err != nil {
// t.streamsQuota will be updated when t.CloseStream is invoked. // Return the quota back now because there is no stream returned to the caller.
if _, ok := err.(StreamError); ok && checkStreamsQuota {
t.streamsQuota.add(1)
}
return nil, err return nil, err
} }
t.mu.Lock() t.mu.Lock()
@ -579,6 +582,11 @@ func (t *http2Client) getStream(f http2.Frame) (*Stream, bool) {
// Window updates will deliver to the controller for sending when // Window updates will deliver to the controller for sending when
// the cumulative quota exceeds the corresponding threshold. // the cumulative quota exceeds the corresponding threshold.
func (t *http2Client) updateWindow(s *Stream, n uint32) { func (t *http2Client) updateWindow(s *Stream, n uint32) {
s.mu.Lock()
defer s.mu.Unlock()
if s.state == streamDone {
return
}
if w := t.fc.onRead(n); w > 0 { if w := t.fc.onRead(n); w > 0 {
t.controlBuf.put(&windowUpdate{0, w}) t.controlBuf.put(&windowUpdate{0, w})
} }

View File

@ -303,6 +303,11 @@ func (t *http2Server) getStream(f http2.Frame) (*Stream, bool) {
// Window updates will deliver to the controller for sending when // Window updates will deliver to the controller for sending when
// the cumulative quota exceeds the corresponding threshold. // the cumulative quota exceeds the corresponding threshold.
func (t *http2Server) updateWindow(s *Stream, n uint32) { func (t *http2Server) updateWindow(s *Stream, n uint32) {
s.mu.Lock()
defer s.mu.Unlock()
if s.state == streamDone {
return
}
if w := t.fc.onRead(n); w > 0 { if w := t.fc.onRead(n); w > 0 {
t.controlBuf.put(&windowUpdate{0, w}) t.controlBuf.put(&windowUpdate{0, w})
} }