reconcile merge

Signed-off-by: Huamin Chen <hchen@redhat.com>
This commit is contained in:
Huamin Chen
2019-01-15 16:20:41 +00:00
parent 85b8415024
commit e46099a504
2425 changed files with 271763 additions and 40453 deletions

View File

@ -14,8 +14,6 @@ matrix:
- go: 1.9.x
- go: 1.9.x
env: GAE=1
- go: 1.8.x
- go: 1.6.x
go_import_path: google.golang.org/grpc

View File

@ -16,7 +16,6 @@ For example, to enable server reflection in `example/helloworld`, we need to mak
--- a/examples/helloworld/greeter_server/main.go
+++ b/examples/helloworld/greeter_server/main.go
@@ -40,6 +40,7 @@ import (
"golang.org/x/net/context"
"google.golang.org/grpc"
pb "google.golang.org/grpc/examples/helloworld/helloworld"
+ "google.golang.org/grpc/reflection"

View File

@ -16,7 +16,7 @@ $ go get -u google.golang.org/grpc
Prerequisites
-------------
This requires Go 1.6 or later. Go 1.7 will be required soon.
gRPC-Go requires Go 1.9 or later.
Constraints
-----------

View File

@ -19,10 +19,10 @@
package grpc
import (
"context"
"net"
"sync"
"golang.org/x/net/context"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/grpclog"

View File

@ -21,11 +21,11 @@
package balancer
import (
"context"
"errors"
"net"
"strings"
"golang.org/x/net/context"
"google.golang.org/grpc/connectivity"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/metadata"
@ -94,6 +94,9 @@ type NewSubConnOptions struct {
// SubConn. If it's nil, the original creds from grpc DialOptions will be
// used.
CredsBundle credentials.Bundle
// HealthCheckEnabled indicates whether health check service should be
// enabled on this SubConn
HealthCheckEnabled bool
}
// ClientConn represents a gRPC ClientConn.

View File

@ -19,7 +19,8 @@
package base
import (
"golang.org/x/net/context"
"context"
"google.golang.org/grpc/balancer"
"google.golang.org/grpc/connectivity"
"google.golang.org/grpc/grpclog"
@ -29,6 +30,7 @@ import (
type baseBuilder struct {
name string
pickerBuilder PickerBuilder
config Config
}
func (bb *baseBuilder) Build(cc balancer.ClientConn, opt balancer.BuildOptions) balancer.Balancer {
@ -43,6 +45,7 @@ func (bb *baseBuilder) Build(cc balancer.ClientConn, opt balancer.BuildOptions)
// ErrNoSubConnAvailable, because when state of a SubConn changes, we
// may call UpdateBalancerState with this picker.
picker: NewErrPicker(balancer.ErrNoSubConnAvailable),
config: bb.config,
}
}
@ -60,6 +63,7 @@ type baseBalancer struct {
subConns map[resolver.Address]balancer.SubConn
scStates map[balancer.SubConn]connectivity.State
picker balancer.Picker
config Config
}
func (b *baseBalancer) HandleResolvedAddrs(addrs []resolver.Address, err error) {
@ -74,7 +78,7 @@ func (b *baseBalancer) HandleResolvedAddrs(addrs []resolver.Address, err error)
addrsSet[a] = struct{}{}
if _, ok := b.subConns[a]; !ok {
// a is a new address (not existing in b.subConns).
sc, err := b.cc.NewSubConn([]resolver.Address{a}, balancer.NewSubConnOptions{})
sc, err := b.cc.NewSubConn([]resolver.Address{a}, balancer.NewSubConnOptions{HealthCheckEnabled: b.config.HealthCheck})
if err != nil {
grpclog.Warningf("base.baseBalancer: failed to create new SubConn: %v", err)
continue

View File

@ -45,8 +45,20 @@ type PickerBuilder interface {
// NewBalancerBuilder returns a balancer builder. The balancers
// built by this builder will use the picker builder to build pickers.
func NewBalancerBuilder(name string, pb PickerBuilder) balancer.Builder {
return NewBalancerBuilderWithConfig(name, pb, Config{})
}
// Config contains the config info about the base balancer builder.
type Config struct {
// HealthCheck indicates whether health checking should be enabled for this specific balancer.
HealthCheck bool
}
// NewBalancerBuilderWithConfig returns a base balancer builder configured by the provided config.
func NewBalancerBuilderWithConfig(name string, pb PickerBuilder, config Config) balancer.Builder {
return &baseBuilder{
name: name,
pickerBuilder: pb,
config: config,
}
}

View File

@ -25,6 +25,7 @@
package grpclb
import (
"context"
"errors"
"strconv"
"strings"
@ -32,7 +33,6 @@ import (
"time"
durationpb "github.com/golang/protobuf/ptypes/duration"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/balancer"
lbpb "google.golang.org/grpc/balancer/grpclb/grpc_lb_v1"

View File

@ -19,10 +19,10 @@
package grpclb
import (
"context"
"sync"
"sync/atomic"
"golang.org/x/net/context"
"google.golang.org/grpc/balancer"
lbpb "google.golang.org/grpc/balancer/grpclb/grpc_lb_v1"
"google.golang.org/grpc/codes"

View File

@ -19,6 +19,7 @@
package grpclb
import (
"context"
"fmt"
"io"
"net"
@ -26,7 +27,6 @@ import (
"time"
timestamppb "github.com/golang/protobuf/ptypes/timestamp"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/balancer"
lbpb "google.golang.org/grpc/balancer/grpclb/grpc_lb_v1"

View File

@ -19,6 +19,7 @@
package grpclb
import (
"context"
"errors"
"fmt"
"io"
@ -31,7 +32,6 @@ import (
"time"
durationpb "github.com/golang/protobuf/ptypes/duration"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/balancer"
lbgrpc "google.golang.org/grpc/balancer/grpclb/grpc_lb_v1"

View File

@ -22,9 +22,9 @@
package roundrobin
import (
"context"
"sync"
"golang.org/x/net/context"
"google.golang.org/grpc/balancer"
"google.golang.org/grpc/balancer/base"
"google.golang.org/grpc/grpclog"
@ -36,7 +36,7 @@ const Name = "round_robin"
// newBuilder creates a new roundrobin balancer builder.
func newBuilder() balancer.Builder {
return base.NewBalancerBuilder(Name, &rrPickerBuilder{})
return base.NewBalancerBuilderWithConfig(Name, &rrPickerBuilder{}, base.Config{HealthCheck: true})
}
func init() {

View File

@ -19,13 +19,13 @@
package roundrobin_test
import (
"context"
"fmt"
"net"
"sync"
"testing"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/balancer/roundrobin"
"google.golang.org/grpc/codes"

View File

@ -229,8 +229,13 @@ func (ccb *ccBalancerWrapper) UpdateBalancerState(s connectivity.State, p balanc
if ccb.subConns == nil {
return
}
ccb.cc.csMgr.updateState(s)
// Update picker before updating state. Even though the ordering here does
// not matter, it can lead to multiple calls of Pick in the common start-up
// case where we wait for ready and then perform an RPC. If the picker is
// updated later, we could call the "connecting" picker when the state is
// updated, and then call the "ready" picker after the picker gets updated.
ccb.cc.blockingpicker.updatePicker(p)
ccb.cc.csMgr.updateState(s)
}
func (ccb *ccBalancerWrapper) ResolveNow(o resolver.ResolveNowOption) {

View File

@ -19,12 +19,12 @@
package grpc
import (
"context"
"fmt"
"math"
"testing"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc/balancer"
"google.golang.org/grpc/balancer/roundrobin"
"google.golang.org/grpc/connectivity"

View File

@ -19,6 +19,7 @@
package grpc
import (
"context"
"fmt"
"math"
"strconv"
@ -26,7 +27,6 @@ import (
"testing"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc/codes"
_ "google.golang.org/grpc/grpclog/glogger"
"google.golang.org/grpc/internal/leakcheck"

View File

@ -19,10 +19,10 @@
package grpc
import (
"context"
"strings"
"sync"
"golang.org/x/net/context"
"google.golang.org/grpc/balancer"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/connectivity"

View File

@ -40,6 +40,7 @@ Assume there are two result files names as "basePerf" and "curPerf" created by a
package main
import (
"context"
"encoding/gob"
"errors"
"flag"
@ -59,7 +60,6 @@ import (
"testing"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc"
bm "google.golang.org/grpc/benchmark"
testpb "google.golang.org/grpc/benchmark/grpc_testing"

View File

@ -24,6 +24,7 @@ Package benchmark implements the building blocks to setup end-to-end gRPC benchm
package benchmark
import (
"context"
"fmt"
"io"
"net"
@ -31,7 +32,6 @@ import (
"testing"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc"
testpb "google.golang.org/grpc/benchmark/grpc_testing"
"google.golang.org/grpc/benchmark/latency"

View File

@ -1,112 +0,0 @@
// +build go1.6,!go1.7
/*
*
* Copyright 2017 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package benchmark
import (
"os"
"testing"
"google.golang.org/grpc"
"google.golang.org/grpc/benchmark/stats"
)
func BenchmarkClientStreamc1(b *testing.B) {
grpc.EnableTracing = true
runStream(b, stats.Features{"", true, 0, 0, 0, 1, 1, 1, false, false})
}
func BenchmarkClientStreamc8(b *testing.B) {
grpc.EnableTracing = true
runStream(b, stats.Features{"", true, 0, 0, 0, 8, 1, 1, false, false})
}
func BenchmarkClientStreamc64(b *testing.B) {
grpc.EnableTracing = true
runStream(b, stats.Features{"", true, 0, 0, 0, 64, 1, 1, false, false})
}
func BenchmarkClientStreamc512(b *testing.B) {
grpc.EnableTracing = true
runStream(b, stats.Features{"", true, 0, 0, 0, 512, 1, 1, false, false})
}
func BenchmarkClientUnaryc1(b *testing.B) {
grpc.EnableTracing = true
runStream(b, stats.Features{"", true, 0, 0, 0, 1, 1, 1, false, false})
}
func BenchmarkClientUnaryc8(b *testing.B) {
grpc.EnableTracing = true
runStream(b, stats.Features{"", true, 0, 0, 0, 8, 1, 1, false, false})
}
func BenchmarkClientUnaryc64(b *testing.B) {
grpc.EnableTracing = true
runStream(b, stats.Features{"", true, 0, 0, 0, 64, 1, 1, false, false})
}
func BenchmarkClientUnaryc512(b *testing.B) {
grpc.EnableTracing = true
runStream(b, stats.Features{"", true, 0, 0, 0, 512, 1, 1, false, false})
}
func BenchmarkClientStreamNoTracec1(b *testing.B) {
grpc.EnableTracing = false
runStream(b, stats.Features{"", false, 0, 0, 0, 1, 1, 1, false, false})
}
func BenchmarkClientStreamNoTracec8(b *testing.B) {
grpc.EnableTracing = false
runStream(b, stats.Features{"", false, 0, 0, 0, 8, 1, 1, false, false})
}
func BenchmarkClientStreamNoTracec64(b *testing.B) {
grpc.EnableTracing = false
runStream(b, stats.Features{"", false, 0, 0, 0, 64, 1, 1, false, false})
}
func BenchmarkClientStreamNoTracec512(b *testing.B) {
grpc.EnableTracing = false
runStream(b, stats.Features{"", false, 0, 0, 0, 512, 1, 1, false, false})
}
func BenchmarkClientUnaryNoTracec1(b *testing.B) {
grpc.EnableTracing = false
runStream(b, stats.Features{"", false, 0, 0, 0, 1, 1, 1, false, false})
}
func BenchmarkClientUnaryNoTracec8(b *testing.B) {
grpc.EnableTracing = false
runStream(b, stats.Features{"", false, 0, 0, 0, 8, 1, 1, false, false})
}
func BenchmarkClientUnaryNoTracec64(b *testing.B) {
grpc.EnableTracing = false
runStream(b, stats.Features{"", false, 0, 0, 0, 64, 1, 1, false, false})
}
func BenchmarkClientUnaryNoTracec512(b *testing.B) {
grpc.EnableTracing = false
runStream(b, stats.Features{"", false, 0, 0, 0, 512, 1, 1, false, false})
runStream(b, stats.Features{"", false, 0, 0, 0, 512, 1, 1, false, false})
}
func TestMain(m *testing.M) {
os.Exit(stats.RunTestMain(m))
}

View File

@ -1,5 +1,3 @@
// +build go1.7
/*
*
* Copyright 2017 gRPC authors.

View File

@ -19,6 +19,7 @@
package main
import (
"context"
"flag"
"fmt"
"os"
@ -27,7 +28,6 @@ import (
"sync"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/benchmark"
testpb "google.golang.org/grpc/benchmark/grpc_testing"

View File

@ -23,13 +23,12 @@ package latency
import (
"bytes"
"context"
"encoding/binary"
"fmt"
"io"
"net"
"time"
"golang.org/x/net/context"
)
// Dialer is a function matching the signature of net.Dial.

View File

@ -19,10 +19,9 @@
package primitives_test
import (
"context"
"testing"
"time"
"golang.org/x/net/context"
)
func BenchmarkCancelContextErrNoErr(b *testing.B) {

View File

@ -1,5 +1,3 @@
// +build go1.7
/*
*
* Copyright 2017 gRPC authors.

View File

@ -19,13 +19,13 @@
package main
import (
"context"
"flag"
"math"
"runtime"
"sync"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/benchmark"
testpb "google.golang.org/grpc/benchmark/grpc_testing"

View File

@ -19,6 +19,7 @@
package main
import (
"context"
"flag"
"fmt"
"io"
@ -29,7 +30,6 @@ import (
"strconv"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc"
testpb "google.golang.org/grpc/benchmark/grpc_testing"
"google.golang.org/grpc/codes"

View File

@ -19,7 +19,7 @@
package grpc
import (
"golang.org/x/net/context"
"context"
)
// Invoke sends the RPC request on the wire and returns after response is

View File

@ -19,6 +19,7 @@
package grpc
import (
"context"
"fmt"
"io"
"math"
@ -29,7 +30,6 @@ import (
"testing"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/internal/leakcheck"
"google.golang.org/grpc/internal/transport"

View File

@ -59,7 +59,7 @@ func (x ChannelConnectivityState_State) String() string {
return proto.EnumName(ChannelConnectivityState_State_name, int32(x))
}
func (ChannelConnectivityState_State) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{2, 0}
return fileDescriptor_channelz_449295370a82a4c0, []int{2, 0}
}
// The supported severity levels of trace events.
@ -89,7 +89,7 @@ func (x ChannelTraceEvent_Severity) String() string {
return proto.EnumName(ChannelTraceEvent_Severity_name, int32(x))
}
func (ChannelTraceEvent_Severity) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{4, 0}
return fileDescriptor_channelz_449295370a82a4c0, []int{4, 0}
}
// Channel is a logical grouping of channels, subchannels, and sockets.
@ -118,7 +118,7 @@ func (m *Channel) Reset() { *m = Channel{} }
func (m *Channel) String() string { return proto.CompactTextString(m) }
func (*Channel) ProtoMessage() {}
func (*Channel) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{0}
return fileDescriptor_channelz_449295370a82a4c0, []int{0}
}
func (m *Channel) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Channel.Unmarshal(m, b)
@ -200,7 +200,7 @@ func (m *Subchannel) Reset() { *m = Subchannel{} }
func (m *Subchannel) String() string { return proto.CompactTextString(m) }
func (*Subchannel) ProtoMessage() {}
func (*Subchannel) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{1}
return fileDescriptor_channelz_449295370a82a4c0, []int{1}
}
func (m *Subchannel) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Subchannel.Unmarshal(m, b)
@ -268,7 +268,7 @@ func (m *ChannelConnectivityState) Reset() { *m = ChannelConnectivitySta
func (m *ChannelConnectivityState) String() string { return proto.CompactTextString(m) }
func (*ChannelConnectivityState) ProtoMessage() {}
func (*ChannelConnectivityState) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{2}
return fileDescriptor_channelz_449295370a82a4c0, []int{2}
}
func (m *ChannelConnectivityState) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ChannelConnectivityState.Unmarshal(m, b)
@ -321,7 +321,7 @@ func (m *ChannelData) Reset() { *m = ChannelData{} }
func (m *ChannelData) String() string { return proto.CompactTextString(m) }
func (*ChannelData) ProtoMessage() {}
func (*ChannelData) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{3}
return fileDescriptor_channelz_449295370a82a4c0, []int{3}
}
func (m *ChannelData) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ChannelData.Unmarshal(m, b)
@ -417,7 +417,7 @@ func (m *ChannelTraceEvent) Reset() { *m = ChannelTraceEvent{} }
func (m *ChannelTraceEvent) String() string { return proto.CompactTextString(m) }
func (*ChannelTraceEvent) ProtoMessage() {}
func (*ChannelTraceEvent) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{4}
return fileDescriptor_channelz_449295370a82a4c0, []int{4}
}
func (m *ChannelTraceEvent) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ChannelTraceEvent.Unmarshal(m, b)
@ -588,7 +588,7 @@ func (m *ChannelTrace) Reset() { *m = ChannelTrace{} }
func (m *ChannelTrace) String() string { return proto.CompactTextString(m) }
func (*ChannelTrace) ProtoMessage() {}
func (*ChannelTrace) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{5}
return fileDescriptor_channelz_449295370a82a4c0, []int{5}
}
func (m *ChannelTrace) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ChannelTrace.Unmarshal(m, b)
@ -644,7 +644,7 @@ func (m *ChannelRef) Reset() { *m = ChannelRef{} }
func (m *ChannelRef) String() string { return proto.CompactTextString(m) }
func (*ChannelRef) ProtoMessage() {}
func (*ChannelRef) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{6}
return fileDescriptor_channelz_449295370a82a4c0, []int{6}
}
func (m *ChannelRef) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ChannelRef.Unmarshal(m, b)
@ -693,7 +693,7 @@ func (m *SubchannelRef) Reset() { *m = SubchannelRef{} }
func (m *SubchannelRef) String() string { return proto.CompactTextString(m) }
func (*SubchannelRef) ProtoMessage() {}
func (*SubchannelRef) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{7}
return fileDescriptor_channelz_449295370a82a4c0, []int{7}
}
func (m *SubchannelRef) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SubchannelRef.Unmarshal(m, b)
@ -729,6 +729,7 @@ func (m *SubchannelRef) GetName() string {
// SocketRef is a reference to a Socket.
type SocketRef struct {
// The globally unique id for this socket. Must be a positive number.
SocketId int64 `protobuf:"varint,3,opt,name=socket_id,json=socketId,proto3" json:"socket_id,omitempty"`
// An optional name associated with the socket.
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
@ -741,7 +742,7 @@ func (m *SocketRef) Reset() { *m = SocketRef{} }
func (m *SocketRef) String() string { return proto.CompactTextString(m) }
func (*SocketRef) ProtoMessage() {}
func (*SocketRef) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{8}
return fileDescriptor_channelz_449295370a82a4c0, []int{8}
}
func (m *SocketRef) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SocketRef.Unmarshal(m, b)
@ -790,7 +791,7 @@ func (m *ServerRef) Reset() { *m = ServerRef{} }
func (m *ServerRef) String() string { return proto.CompactTextString(m) }
func (*ServerRef) ProtoMessage() {}
func (*ServerRef) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{9}
return fileDescriptor_channelz_449295370a82a4c0, []int{9}
}
func (m *ServerRef) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ServerRef.Unmarshal(m, b)
@ -843,7 +844,7 @@ func (m *Server) Reset() { *m = Server{} }
func (m *Server) String() string { return proto.CompactTextString(m) }
func (*Server) ProtoMessage() {}
func (*Server) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{10}
return fileDescriptor_channelz_449295370a82a4c0, []int{10}
}
func (m *Server) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Server.Unmarshal(m, b)
@ -905,7 +906,7 @@ func (m *ServerData) Reset() { *m = ServerData{} }
func (m *ServerData) String() string { return proto.CompactTextString(m) }
func (*ServerData) ProtoMessage() {}
func (*ServerData) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{11}
return fileDescriptor_channelz_449295370a82a4c0, []int{11}
}
func (m *ServerData) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ServerData.Unmarshal(m, b)
@ -985,7 +986,7 @@ func (m *Socket) Reset() { *m = Socket{} }
func (m *Socket) String() string { return proto.CompactTextString(m) }
func (*Socket) ProtoMessage() {}
func (*Socket) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{12}
return fileDescriptor_channelz_449295370a82a4c0, []int{12}
}
func (m *Socket) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Socket.Unmarshal(m, b)
@ -1086,7 +1087,8 @@ type SocketData struct {
// This may be slightly out of date due to network latency. This does NOT
// include stream level or TCP level flow control info.
RemoteFlowControlWindow *wrappers.Int64Value `protobuf:"bytes,12,opt,name=remote_flow_control_window,json=remoteFlowControlWindow,proto3" json:"remote_flow_control_window,omitempty"`
// Socket options set on this socket. May be absent.
// Socket options set on this socket. May be absent if 'summary' is set
// on GetSocketRequest.
Option []*SocketOption `protobuf:"bytes,13,rep,name=option,proto3" json:"option,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
@ -1097,7 +1099,7 @@ func (m *SocketData) Reset() { *m = SocketData{} }
func (m *SocketData) String() string { return proto.CompactTextString(m) }
func (*SocketData) ProtoMessage() {}
func (*SocketData) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{13}
return fileDescriptor_channelz_449295370a82a4c0, []int{13}
}
func (m *SocketData) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SocketData.Unmarshal(m, b)
@ -1224,7 +1226,7 @@ func (m *Address) Reset() { *m = Address{} }
func (m *Address) String() string { return proto.CompactTextString(m) }
func (*Address) ProtoMessage() {}
func (*Address) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{14}
return fileDescriptor_channelz_449295370a82a4c0, []int{14}
}
func (m *Address) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Address.Unmarshal(m, b)
@ -1402,7 +1404,7 @@ func (m *Address_TcpIpAddress) Reset() { *m = Address_TcpIpAddress{} }
func (m *Address_TcpIpAddress) String() string { return proto.CompactTextString(m) }
func (*Address_TcpIpAddress) ProtoMessage() {}
func (*Address_TcpIpAddress) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{14, 0}
return fileDescriptor_channelz_449295370a82a4c0, []int{14, 0}
}
func (m *Address_TcpIpAddress) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Address_TcpIpAddress.Unmarshal(m, b)
@ -1448,7 +1450,7 @@ func (m *Address_UdsAddress) Reset() { *m = Address_UdsAddress{} }
func (m *Address_UdsAddress) String() string { return proto.CompactTextString(m) }
func (*Address_UdsAddress) ProtoMessage() {}
func (*Address_UdsAddress) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{14, 1}
return fileDescriptor_channelz_449295370a82a4c0, []int{14, 1}
}
func (m *Address_UdsAddress) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Address_UdsAddress.Unmarshal(m, b)
@ -1490,7 +1492,7 @@ func (m *Address_OtherAddress) Reset() { *m = Address_OtherAddress{} }
func (m *Address_OtherAddress) String() string { return proto.CompactTextString(m) }
func (*Address_OtherAddress) ProtoMessage() {}
func (*Address_OtherAddress) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{14, 2}
return fileDescriptor_channelz_449295370a82a4c0, []int{14, 2}
}
func (m *Address_OtherAddress) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Address_OtherAddress.Unmarshal(m, b)
@ -1539,7 +1541,7 @@ func (m *Security) Reset() { *m = Security{} }
func (m *Security) String() string { return proto.CompactTextString(m) }
func (*Security) ProtoMessage() {}
func (*Security) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{15}
return fileDescriptor_channelz_449295370a82a4c0, []int{15}
}
func (m *Security) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Security.Unmarshal(m, b)
@ -1688,7 +1690,7 @@ func (m *Security_Tls) Reset() { *m = Security_Tls{} }
func (m *Security_Tls) String() string { return proto.CompactTextString(m) }
func (*Security_Tls) ProtoMessage() {}
func (*Security_Tls) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{15, 0}
return fileDescriptor_channelz_449295370a82a4c0, []int{15, 0}
}
func (m *Security_Tls) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Security_Tls.Unmarshal(m, b)
@ -1839,7 +1841,7 @@ func (m *Security_OtherSecurity) Reset() { *m = Security_OtherSecurity{}
func (m *Security_OtherSecurity) String() string { return proto.CompactTextString(m) }
func (*Security_OtherSecurity) ProtoMessage() {}
func (*Security_OtherSecurity) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{15, 1}
return fileDescriptor_channelz_449295370a82a4c0, []int{15, 1}
}
func (m *Security_OtherSecurity) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Security_OtherSecurity.Unmarshal(m, b)
@ -1894,7 +1896,7 @@ func (m *SocketOption) Reset() { *m = SocketOption{} }
func (m *SocketOption) String() string { return proto.CompactTextString(m) }
func (*SocketOption) ProtoMessage() {}
func (*SocketOption) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{16}
return fileDescriptor_channelz_449295370a82a4c0, []int{16}
}
func (m *SocketOption) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SocketOption.Unmarshal(m, b)
@ -1948,7 +1950,7 @@ func (m *SocketOptionTimeout) Reset() { *m = SocketOptionTimeout{} }
func (m *SocketOptionTimeout) String() string { return proto.CompactTextString(m) }
func (*SocketOptionTimeout) ProtoMessage() {}
func (*SocketOptionTimeout) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{17}
return fileDescriptor_channelz_449295370a82a4c0, []int{17}
}
func (m *SocketOptionTimeout) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SocketOptionTimeout.Unmarshal(m, b)
@ -1991,7 +1993,7 @@ func (m *SocketOptionLinger) Reset() { *m = SocketOptionLinger{} }
func (m *SocketOptionLinger) String() string { return proto.CompactTextString(m) }
func (*SocketOptionLinger) ProtoMessage() {}
func (*SocketOptionLinger) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{18}
return fileDescriptor_channelz_449295370a82a4c0, []int{18}
}
func (m *SocketOptionLinger) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SocketOptionLinger.Unmarshal(m, b)
@ -2066,7 +2068,7 @@ func (m *SocketOptionTcpInfo) Reset() { *m = SocketOptionTcpInfo{} }
func (m *SocketOptionTcpInfo) String() string { return proto.CompactTextString(m) }
func (*SocketOptionTcpInfo) ProtoMessage() {}
func (*SocketOptionTcpInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{19}
return fileDescriptor_channelz_449295370a82a4c0, []int{19}
}
func (m *SocketOptionTcpInfo) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SocketOptionTcpInfo.Unmarshal(m, b)
@ -2292,7 +2294,14 @@ func (m *SocketOptionTcpInfo) GetTcpiReordering() uint32 {
type GetTopChannelsRequest struct {
// start_channel_id indicates that only channels at or above this id should be
// included in the results.
StartChannelId int64 `protobuf:"varint,1,opt,name=start_channel_id,json=startChannelId,proto3" json:"start_channel_id,omitempty"`
// To request the first page, this should be set to 0. To request
// subsequent pages, the client generates this value by adding 1 to
// the highest seen result ID.
StartChannelId int64 `protobuf:"varint,1,opt,name=start_channel_id,json=startChannelId,proto3" json:"start_channel_id,omitempty"`
// If non-zero, the server will return a page of results containing
// at most this many items. If zero, the server will choose a
// reasonable page size. Must never be negative.
MaxResults int64 `protobuf:"varint,2,opt,name=max_results,json=maxResults,proto3" json:"max_results,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -2302,7 +2311,7 @@ func (m *GetTopChannelsRequest) Reset() { *m = GetTopChannelsRequest{} }
func (m *GetTopChannelsRequest) String() string { return proto.CompactTextString(m) }
func (*GetTopChannelsRequest) ProtoMessage() {}
func (*GetTopChannelsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{20}
return fileDescriptor_channelz_449295370a82a4c0, []int{20}
}
func (m *GetTopChannelsRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetTopChannelsRequest.Unmarshal(m, b)
@ -2329,9 +2338,17 @@ func (m *GetTopChannelsRequest) GetStartChannelId() int64 {
return 0
}
func (m *GetTopChannelsRequest) GetMaxResults() int64 {
if m != nil {
return m.MaxResults
}
return 0
}
type GetTopChannelsResponse struct {
// list of channels that the connection detail service knows about. Sorted in
// ascending channel_id order.
// Must contain at least 1 result, otherwise 'end' must be true.
Channel []*Channel `protobuf:"bytes,1,rep,name=channel,proto3" json:"channel,omitempty"`
// If set, indicates that the list of channels is the final list. Requesting
// more channels can only return more if they are created after this RPC
@ -2346,7 +2363,7 @@ func (m *GetTopChannelsResponse) Reset() { *m = GetTopChannelsResponse{}
func (m *GetTopChannelsResponse) String() string { return proto.CompactTextString(m) }
func (*GetTopChannelsResponse) ProtoMessage() {}
func (*GetTopChannelsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{21}
return fileDescriptor_channelz_449295370a82a4c0, []int{21}
}
func (m *GetTopChannelsResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetTopChannelsResponse.Unmarshal(m, b)
@ -2383,7 +2400,14 @@ func (m *GetTopChannelsResponse) GetEnd() bool {
type GetServersRequest struct {
// start_server_id indicates that only servers at or above this id should be
// included in the results.
StartServerId int64 `protobuf:"varint,1,opt,name=start_server_id,json=startServerId,proto3" json:"start_server_id,omitempty"`
// To request the first page, this must be set to 0. To request
// subsequent pages, the client generates this value by adding 1 to
// the highest seen result ID.
StartServerId int64 `protobuf:"varint,1,opt,name=start_server_id,json=startServerId,proto3" json:"start_server_id,omitempty"`
// If non-zero, the server will return a page of results containing
// at most this many items. If zero, the server will choose a
// reasonable page size. Must never be negative.
MaxResults int64 `protobuf:"varint,2,opt,name=max_results,json=maxResults,proto3" json:"max_results,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -2393,7 +2417,7 @@ func (m *GetServersRequest) Reset() { *m = GetServersRequest{} }
func (m *GetServersRequest) String() string { return proto.CompactTextString(m) }
func (*GetServersRequest) ProtoMessage() {}
func (*GetServersRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{22}
return fileDescriptor_channelz_449295370a82a4c0, []int{22}
}
func (m *GetServersRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetServersRequest.Unmarshal(m, b)
@ -2420,9 +2444,17 @@ func (m *GetServersRequest) GetStartServerId() int64 {
return 0
}
func (m *GetServersRequest) GetMaxResults() int64 {
if m != nil {
return m.MaxResults
}
return 0
}
type GetServersResponse struct {
// list of servers that the connection detail service knows about. Sorted in
// ascending server_id order.
// Must contain at least 1 result, otherwise 'end' must be true.
Server []*Server `protobuf:"bytes,1,rep,name=server,proto3" json:"server,omitempty"`
// If set, indicates that the list of servers is the final list. Requesting
// more servers will only return more if they are created after this RPC
@ -2437,7 +2469,7 @@ func (m *GetServersResponse) Reset() { *m = GetServersResponse{} }
func (m *GetServersResponse) String() string { return proto.CompactTextString(m) }
func (*GetServersResponse) ProtoMessage() {}
func (*GetServersResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{23}
return fileDescriptor_channelz_449295370a82a4c0, []int{23}
}
func (m *GetServersResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetServersResponse.Unmarshal(m, b)
@ -2471,11 +2503,97 @@ func (m *GetServersResponse) GetEnd() bool {
return false
}
type GetServerRequest struct {
// server_id is the identifier of the specific server to get.
ServerId int64 `protobuf:"varint,1,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetServerRequest) Reset() { *m = GetServerRequest{} }
func (m *GetServerRequest) String() string { return proto.CompactTextString(m) }
func (*GetServerRequest) ProtoMessage() {}
func (*GetServerRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_449295370a82a4c0, []int{24}
}
func (m *GetServerRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetServerRequest.Unmarshal(m, b)
}
func (m *GetServerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetServerRequest.Marshal(b, m, deterministic)
}
func (dst *GetServerRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetServerRequest.Merge(dst, src)
}
func (m *GetServerRequest) XXX_Size() int {
return xxx_messageInfo_GetServerRequest.Size(m)
}
func (m *GetServerRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetServerRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetServerRequest proto.InternalMessageInfo
func (m *GetServerRequest) GetServerId() int64 {
if m != nil {
return m.ServerId
}
return 0
}
type GetServerResponse struct {
// The Server that corresponds to the requested server_id. This field
// should be set.
Server *Server `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetServerResponse) Reset() { *m = GetServerResponse{} }
func (m *GetServerResponse) String() string { return proto.CompactTextString(m) }
func (*GetServerResponse) ProtoMessage() {}
func (*GetServerResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_449295370a82a4c0, []int{25}
}
func (m *GetServerResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetServerResponse.Unmarshal(m, b)
}
func (m *GetServerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetServerResponse.Marshal(b, m, deterministic)
}
func (dst *GetServerResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetServerResponse.Merge(dst, src)
}
func (m *GetServerResponse) XXX_Size() int {
return xxx_messageInfo_GetServerResponse.Size(m)
}
func (m *GetServerResponse) XXX_DiscardUnknown() {
xxx_messageInfo_GetServerResponse.DiscardUnknown(m)
}
var xxx_messageInfo_GetServerResponse proto.InternalMessageInfo
func (m *GetServerResponse) GetServer() *Server {
if m != nil {
return m.Server
}
return nil
}
type GetServerSocketsRequest struct {
ServerId int64 `protobuf:"varint,1,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"`
// start_socket_id indicates that only sockets at or above this id should be
// included in the results.
StartSocketId int64 `protobuf:"varint,2,opt,name=start_socket_id,json=startSocketId,proto3" json:"start_socket_id,omitempty"`
// To request the first page, this must be set to 0. To request
// subsequent pages, the client generates this value by adding 1 to
// the highest seen result ID.
StartSocketId int64 `protobuf:"varint,2,opt,name=start_socket_id,json=startSocketId,proto3" json:"start_socket_id,omitempty"`
// If non-zero, the server will return a page of results containing
// at most this many items. If zero, the server will choose a
// reasonable page size. Must never be negative.
MaxResults int64 `protobuf:"varint,3,opt,name=max_results,json=maxResults,proto3" json:"max_results,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -2485,7 +2603,7 @@ func (m *GetServerSocketsRequest) Reset() { *m = GetServerSocketsRequest
func (m *GetServerSocketsRequest) String() string { return proto.CompactTextString(m) }
func (*GetServerSocketsRequest) ProtoMessage() {}
func (*GetServerSocketsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{24}
return fileDescriptor_channelz_449295370a82a4c0, []int{26}
}
func (m *GetServerSocketsRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetServerSocketsRequest.Unmarshal(m, b)
@ -2519,9 +2637,17 @@ func (m *GetServerSocketsRequest) GetStartSocketId() int64 {
return 0
}
func (m *GetServerSocketsRequest) GetMaxResults() int64 {
if m != nil {
return m.MaxResults
}
return 0
}
type GetServerSocketsResponse struct {
// list of socket refs that the connection detail service knows about. Sorted in
// ascending socket_id order.
// Must contain at least 1 result, otherwise 'end' must be true.
SocketRef []*SocketRef `protobuf:"bytes,1,rep,name=socket_ref,json=socketRef,proto3" json:"socket_ref,omitempty"`
// If set, indicates that the list of sockets is the final list. Requesting
// more sockets will only return more if they are created after this RPC
@ -2536,7 +2662,7 @@ func (m *GetServerSocketsResponse) Reset() { *m = GetServerSocketsRespon
func (m *GetServerSocketsResponse) String() string { return proto.CompactTextString(m) }
func (*GetServerSocketsResponse) ProtoMessage() {}
func (*GetServerSocketsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{25}
return fileDescriptor_channelz_449295370a82a4c0, []int{27}
}
func (m *GetServerSocketsResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetServerSocketsResponse.Unmarshal(m, b)
@ -2582,7 +2708,7 @@ func (m *GetChannelRequest) Reset() { *m = GetChannelRequest{} }
func (m *GetChannelRequest) String() string { return proto.CompactTextString(m) }
func (*GetChannelRequest) ProtoMessage() {}
func (*GetChannelRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{26}
return fileDescriptor_channelz_449295370a82a4c0, []int{28}
}
func (m *GetChannelRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetChannelRequest.Unmarshal(m, b)
@ -2622,7 +2748,7 @@ func (m *GetChannelResponse) Reset() { *m = GetChannelResponse{} }
func (m *GetChannelResponse) String() string { return proto.CompactTextString(m) }
func (*GetChannelResponse) ProtoMessage() {}
func (*GetChannelResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{27}
return fileDescriptor_channelz_449295370a82a4c0, []int{29}
}
func (m *GetChannelResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetChannelResponse.Unmarshal(m, b)
@ -2661,7 +2787,7 @@ func (m *GetSubchannelRequest) Reset() { *m = GetSubchannelRequest{} }
func (m *GetSubchannelRequest) String() string { return proto.CompactTextString(m) }
func (*GetSubchannelRequest) ProtoMessage() {}
func (*GetSubchannelRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{28}
return fileDescriptor_channelz_449295370a82a4c0, []int{30}
}
func (m *GetSubchannelRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetSubchannelRequest.Unmarshal(m, b)
@ -2701,7 +2827,7 @@ func (m *GetSubchannelResponse) Reset() { *m = GetSubchannelResponse{} }
func (m *GetSubchannelResponse) String() string { return proto.CompactTextString(m) }
func (*GetSubchannelResponse) ProtoMessage() {}
func (*GetSubchannelResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{29}
return fileDescriptor_channelz_449295370a82a4c0, []int{31}
}
func (m *GetSubchannelResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetSubchannelResponse.Unmarshal(m, b)
@ -2730,7 +2856,11 @@ func (m *GetSubchannelResponse) GetSubchannel() *Subchannel {
type GetSocketRequest struct {
// socket_id is the identifier of the specific socket to get.
SocketId int64 `protobuf:"varint,1,opt,name=socket_id,json=socketId,proto3" json:"socket_id,omitempty"`
SocketId int64 `protobuf:"varint,1,opt,name=socket_id,json=socketId,proto3" json:"socket_id,omitempty"`
// If true, the response will contain only high level information
// that is inexpensive to obtain. Fields thay may be omitted are
// documented.
Summary bool `protobuf:"varint,2,opt,name=summary,proto3" json:"summary,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -2740,7 +2870,7 @@ func (m *GetSocketRequest) Reset() { *m = GetSocketRequest{} }
func (m *GetSocketRequest) String() string { return proto.CompactTextString(m) }
func (*GetSocketRequest) ProtoMessage() {}
func (*GetSocketRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{30}
return fileDescriptor_channelz_449295370a82a4c0, []int{32}
}
func (m *GetSocketRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetSocketRequest.Unmarshal(m, b)
@ -2767,6 +2897,13 @@ func (m *GetSocketRequest) GetSocketId() int64 {
return 0
}
func (m *GetSocketRequest) GetSummary() bool {
if m != nil {
return m.Summary
}
return false
}
type GetSocketResponse struct {
// The Socket that corresponds to the requested socket_id. This field
// should be set.
@ -2780,7 +2917,7 @@ func (m *GetSocketResponse) Reset() { *m = GetSocketResponse{} }
func (m *GetSocketResponse) String() string { return proto.CompactTextString(m) }
func (*GetSocketResponse) ProtoMessage() {}
func (*GetSocketResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_channelz_ce3ed45d08251f2f, []int{31}
return fileDescriptor_channelz_449295370a82a4c0, []int{33}
}
func (m *GetSocketResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetSocketResponse.Unmarshal(m, b)
@ -2837,6 +2974,8 @@ func init() {
proto.RegisterType((*GetTopChannelsResponse)(nil), "grpc.channelz.v1.GetTopChannelsResponse")
proto.RegisterType((*GetServersRequest)(nil), "grpc.channelz.v1.GetServersRequest")
proto.RegisterType((*GetServersResponse)(nil), "grpc.channelz.v1.GetServersResponse")
proto.RegisterType((*GetServerRequest)(nil), "grpc.channelz.v1.GetServerRequest")
proto.RegisterType((*GetServerResponse)(nil), "grpc.channelz.v1.GetServerResponse")
proto.RegisterType((*GetServerSocketsRequest)(nil), "grpc.channelz.v1.GetServerSocketsRequest")
proto.RegisterType((*GetServerSocketsResponse)(nil), "grpc.channelz.v1.GetServerSocketsResponse")
proto.RegisterType((*GetChannelRequest)(nil), "grpc.channelz.v1.GetChannelRequest")
@ -2866,6 +3005,8 @@ type ChannelzClient interface {
GetTopChannels(ctx context.Context, in *GetTopChannelsRequest, opts ...grpc.CallOption) (*GetTopChannelsResponse, error)
// Gets all servers that exist in the process.
GetServers(ctx context.Context, in *GetServersRequest, opts ...grpc.CallOption) (*GetServersResponse, error)
// Returns a single Server, or else a NOT_FOUND code.
GetServer(ctx context.Context, in *GetServerRequest, opts ...grpc.CallOption) (*GetServerResponse, error)
// Gets all server sockets that exist in the process.
GetServerSockets(ctx context.Context, in *GetServerSocketsRequest, opts ...grpc.CallOption) (*GetServerSocketsResponse, error)
// Returns a single Channel, or else a NOT_FOUND code.
@ -2902,6 +3043,15 @@ func (c *channelzClient) GetServers(ctx context.Context, in *GetServersRequest,
return out, nil
}
func (c *channelzClient) GetServer(ctx context.Context, in *GetServerRequest, opts ...grpc.CallOption) (*GetServerResponse, error) {
out := new(GetServerResponse)
err := c.cc.Invoke(ctx, "/grpc.channelz.v1.Channelz/GetServer", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *channelzClient) GetServerSockets(ctx context.Context, in *GetServerSocketsRequest, opts ...grpc.CallOption) (*GetServerSocketsResponse, error) {
out := new(GetServerSocketsResponse)
err := c.cc.Invoke(ctx, "/grpc.channelz.v1.Channelz/GetServerSockets", in, out, opts...)
@ -2945,6 +3095,8 @@ type ChannelzServer interface {
GetTopChannels(context.Context, *GetTopChannelsRequest) (*GetTopChannelsResponse, error)
// Gets all servers that exist in the process.
GetServers(context.Context, *GetServersRequest) (*GetServersResponse, error)
// Returns a single Server, or else a NOT_FOUND code.
GetServer(context.Context, *GetServerRequest) (*GetServerResponse, error)
// Gets all server sockets that exist in the process.
GetServerSockets(context.Context, *GetServerSocketsRequest) (*GetServerSocketsResponse, error)
// Returns a single Channel, or else a NOT_FOUND code.
@ -2995,6 +3147,24 @@ func _Channelz_GetServers_Handler(srv interface{}, ctx context.Context, dec func
return interceptor(ctx, in, info, handler)
}
func _Channelz_GetServer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetServerRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ChannelzServer).GetServer(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/grpc.channelz.v1.Channelz/GetServer",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ChannelzServer).GetServer(ctx, req.(*GetServerRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Channelz_GetServerSockets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetServerSocketsRequest)
if err := dec(in); err != nil {
@ -3079,6 +3249,10 @@ var _Channelz_serviceDesc = grpc.ServiceDesc{
MethodName: "GetServers",
Handler: _Channelz_GetServers_Handler,
},
{
MethodName: "GetServer",
Handler: _Channelz_GetServer_Handler,
},
{
MethodName: "GetServerSockets",
Handler: _Channelz_GetServerSockets_Handler,
@ -3101,167 +3275,171 @@ var _Channelz_serviceDesc = grpc.ServiceDesc{
}
func init() {
proto.RegisterFile("grpc/channelz/v1/channelz.proto", fileDescriptor_channelz_ce3ed45d08251f2f)
proto.RegisterFile("grpc/channelz/v1/channelz.proto", fileDescriptor_channelz_449295370a82a4c0)
}
var fileDescriptor_channelz_ce3ed45d08251f2f = []byte{
// 2515 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0x4b, 0x6f, 0xdb, 0xca,
0x15, 0xb6, 0xde, 0xd4, 0xd1, 0x23, 0xf2, 0xe4, 0x45, 0x2b, 0x0f, 0xbb, 0x74, 0x6e, 0xe2, 0x9b,
0x34, 0x72, 0xec, 0x9b, 0x06, 0x45, 0xd3, 0xa2, 0x57, 0x56, 0xec, 0x58, 0xae, 0x23, 0x07, 0x94,
0x7c, 0x93, 0xdb, 0xc5, 0xe5, 0x65, 0xc8, 0xb1, 0xcc, 0x9a, 0x22, 0x55, 0xce, 0x48, 0x46, 0xb2,
0xed, 0xbe, 0xcb, 0xa2, 0xbf, 0xa0, 0x9b, 0x2e, 0x0a, 0x14, 0x28, 0xd0, 0x6e, 0x8b, 0xfe, 0x99,
0xfe, 0x8b, 0x62, 0x1e, 0x7c, 0xc8, 0x92, 0x2c, 0x07, 0x59, 0x76, 0x63, 0x88, 0x87, 0xdf, 0xf9,
0xce, 0x99, 0xf3, 0x9a, 0xe1, 0x18, 0x56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0x05, 0x7c, 0x32, 0xc6, 0x5b, 0x1f,
0xf2, 0xfc, 0x08, 0xfa, 0xcd, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd3, 0x7a, 0xae, 0xc5, 0x94,
0x1e, 0x00, 0x00,
var fileDescriptor_channelz_449295370a82a4c0 = []byte{
// 2584 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0x4b, 0x6f, 0xdb, 0xd8,
0xf5, 0xb7, 0xde, 0xd4, 0xd1, 0x23, 0xf2, 0x4d, 0x26, 0x43, 0x2b, 0x99, 0xb1, 0xff, 0xf4, 0x4c,
0xc6, 0x93, 0xfc, 0x23, 0xc7, 0x9e, 0x34, 0x28, 0x3a, 0x2d, 0x3a, 0xb6, 0x62, 0xc7, 0x72, 0x1d,
0x39, 0xa0, 0xe4, 0x49, 0xa6, 0x28, 0xca, 0xa1, 0xc9, 0x6b, 0x99, 0x35, 0x45, 0xaa, 0xbc, 0x57,
0xf2, 0x24, 0x9b, 0x2e, 0xba, 0xef, 0xb2, 0x28, 0xfa, 0x01, 0xba, 0xe9, 0xa2, 0x40, 0x81, 0x02,
0xed, 0xb6, 0xdf, 0xa6, 0xdf, 0xa2, 0xb8, 0x0f, 0x3e, 0xf4, 0xb2, 0x14, 0x64, 0xd9, 0x8d, 0x21,
0x1e, 0xfe, 0xce, 0xef, 0x9c, 0x7b, 0x5e, 0xf7, 0xf2, 0x1a, 0xd6, 0x7b, 0xc1, 0xc0, 0xda, 0xb6,
0x2e, 0x4d, 0xcf, 0xc3, 0xee, 0xbb, 0xed, 0xd1, 0x4e, 0xf4, 0xbb, 0x31, 0x08, 0x7c, 0xea, 0xa3,
0x1a, 0x03, 0x34, 0x22, 0xe1, 0x68, 0xa7, 0xbe, 0xd6, 0xf3, 0xfd, 0x9e, 0x8b, 0xb7, 0xf9, 0xfb,
0xf3, 0xe1, 0xc5, 0xb6, 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, 0x1a, 0x7e, 0xd0, 0xdb, 0x1e, 0xff, 0xb7, 0x3d, 0x7b, 0x0a, 0x77,
0xd3, 0x77, 0xc6, 0x68, 0xe7, 0x3c, 0xcf, 0x4f, 0xf3, 0x5f, 0xfd, 0x37, 0x00, 0x00, 0xff, 0xff,
0x54, 0xae, 0x0b, 0x93, 0xdf, 0x1f, 0x00, 0x00,
}

View File

@ -1,4 +1,4 @@
// +build !appengine,go1.7
// +build !appengine
/*
*

View File

@ -1,4 +1,4 @@
// +build !linux appengine !go1.7
// +build !linux appengine
/*
*

View File

@ -22,19 +22,21 @@
package service
import (
"context"
"net"
"time"
"github.com/golang/protobuf/ptypes"
durpb "github.com/golang/protobuf/ptypes/duration"
wrpb "github.com/golang/protobuf/ptypes/wrappers"
"golang.org/x/net/context"
"google.golang.org/grpc"
channelzgrpc "google.golang.org/grpc/channelz/grpc_channelz_v1"
channelzpb "google.golang.org/grpc/channelz/grpc_channelz_v1"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/connectivity"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/internal/channelz"
"google.golang.org/grpc/status"
)
func init() {
@ -333,3 +335,7 @@ func (s *serverImpl) GetSocket(ctx context.Context, req *channelzpb.GetSocketReq
resp := &channelzpb.GetSocketResponse{Socket: socketMetricToProto(metric)}
return resp, nil
}
func (s *serverImpl) GetServer(ctx context.Context, req *channelzpb.GetServerRequest) (*channelzpb.GetServerResponse, error) {
return nil, status.Error(codes.Unimplemented, "GetServer not implemented")
}

View File

@ -1,4 +1,4 @@
// +build linux,!appengine,go1.7
// +build linux,!appengine
// +build 386 amd64
/*
@ -26,13 +26,13 @@
package service
import (
"context"
"reflect"
"strconv"
"testing"
"github.com/golang/protobuf/ptypes"
durpb "github.com/golang/protobuf/ptypes/duration"
"golang.org/x/net/context"
"golang.org/x/sys/unix"
channelzpb "google.golang.org/grpc/channelz/grpc_channelz_v1"
"google.golang.org/grpc/internal/channelz"

View File

@ -19,6 +19,7 @@
package service
import (
"context"
"fmt"
"net"
"reflect"
@ -28,7 +29,6 @@ import (
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
"golang.org/x/net/context"
channelzpb "google.golang.org/grpc/channelz/grpc_channelz_v1"
"google.golang.org/grpc/connectivity"
"google.golang.org/grpc/credentials"
@ -51,6 +51,7 @@ var protoToSocketOpt protoToSocketOptFunc
// with &utcLoc. However zero value of a time.Time type value loc field is nil.
// This behavior will make reflect.DeepEqual fail upon unset time.Time field,
// and cause false positive fatal error.
// TODO: Go1.7 is no longer supported - does this need a change?
var emptyTime time.Time
type dummyChannel struct {
@ -402,6 +403,33 @@ func TestGetServerSockets(t *testing.T) {
}
}
// This test makes a GetServerSockets with a non-zero start ID, and expect only
// sockets with ID >= the given start ID.
func TestGetServerSocketsNonZeroStartID(t *testing.T) {
channelz.NewChannelzStorage()
svrID := channelz.RegisterServer(&dummyServer{}, "")
refNames := []string{"listen socket 1", "normal socket 1", "normal socket 2"}
ids := make([]int64, 3)
ids[0] = channelz.RegisterListenSocket(&dummySocket{}, svrID, refNames[0])
ids[1] = channelz.RegisterNormalSocket(&dummySocket{}, svrID, refNames[1])
ids[2] = channelz.RegisterNormalSocket(&dummySocket{}, svrID, refNames[2])
svr := newCZServer()
// Make GetServerSockets with startID = ids[1]+1, so socket-1 won't be
// included in the response.
resp, _ := svr.GetServerSockets(context.Background(), &channelzpb.GetServerSocketsRequest{ServerId: svrID, StartSocketId: ids[1] + 1})
if !resp.GetEnd() {
t.Fatalf("resp.GetEnd() want: true, got: %v", resp.GetEnd())
}
// GetServerSockets only return normal socket-2, socket-1 should be
// filtered by start ID.
want := map[int64]string{
ids[2]: refNames[2],
}
if !reflect.DeepEqual(convertSocketRefSliceToMap(resp.GetSocketRef()), want) {
t.Fatalf("GetServerSockets want: %#v, got: %#v", want, resp.GetSocketRef())
}
}
func TestGetChannel(t *testing.T) {
channelz.NewChannelzStorage()
refNames := []string{"top channel 1", "nested channel 1", "sub channel 2", "nested channel 3"}

View File

@ -1,4 +1,4 @@
// +build 386,linux,!appengine,go1.7
// +build 386,linux,!appengine
/*
*

View File

@ -1,4 +1,4 @@
// +build amd64,linux,!appengine,go1.7
// +build amd64,linux,!appengine
/*
*

View File

@ -19,6 +19,7 @@
package grpc
import (
"context"
"errors"
"fmt"
"math"
@ -29,15 +30,17 @@ import (
"sync/atomic"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc/balancer"
_ "google.golang.org/grpc/balancer/roundrobin" // To register roundrobin.
"google.golang.org/grpc/codes"
"google.golang.org/grpc/connectivity"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/internal"
"google.golang.org/grpc/internal/backoff"
"google.golang.org/grpc/internal/channelz"
"google.golang.org/grpc/internal/envconfig"
"google.golang.org/grpc/internal/grpcsync"
"google.golang.org/grpc/internal/transport"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/metadata"
@ -123,12 +126,13 @@ func Dial(target string, opts ...DialOption) (*ClientConn, error) {
// e.g. to use dns resolver, a "dns:///" prefix should be applied to the target.
func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *ClientConn, err error) {
cc := &ClientConn{
target: target,
csMgr: &connectivityStateManager{},
conns: make(map[*addrConn]struct{}),
dopts: defaultDialOptions(),
blockingpicker: newPickerWrapper(),
czData: new(channelzData),
target: target,
csMgr: &connectivityStateManager{},
conns: make(map[*addrConn]struct{}),
dopts: defaultDialOptions(),
blockingpicker: newPickerWrapper(),
czData: new(channelzData),
firstResolveEvent: grpcsync.NewEvent(),
}
cc.retryThrottler.Store((*retryThrottler)(nil))
cc.ctx, cc.cancel = context.WithCancel(context.Background())
@ -182,7 +186,7 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *
cc.dopts.copts.Dialer = newProxyDialer(
func(ctx context.Context, addr string) (net.Conn, error) {
network, addr := parseDialTarget(addr)
return dialContext(ctx, network, addr)
return (&net.Dialer{}).DialContext(ctx, network, addr)
},
)
}
@ -285,19 +289,14 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *
}
// Build the resolver.
cc.resolverWrapper, err = newCCResolverWrapper(cc)
rWrapper, err := newCCResolverWrapper(cc)
if err != nil {
return nil, fmt.Errorf("failed to build resolver: %v", err)
}
// Start the resolver wrapper goroutine after resolverWrapper is created.
//
// If the goroutine is started before resolverWrapper is ready, the
// following may happen: The goroutine sends updates to cc. cc forwards
// those to balancer. Balancer creates new addrConn. addrConn fails to
// connect, and calls resolveNow(). resolveNow() tries to use the non-ready
// resolverWrapper.
cc.resolverWrapper.start()
cc.mu.Lock()
cc.resolverWrapper = rWrapper
cc.mu.Unlock()
// A blocking dial blocks until the clientConn is ready.
if cc.dopts.block {
for {
@ -306,7 +305,9 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *
break
} else if cc.dopts.copts.FailOnNonTempDialError && s == connectivity.TransientFailure {
if err = cc.blockingpicker.connectionError(); err != nil {
terr, ok := err.(interface{ Temporary() bool })
terr, ok := err.(interface {
Temporary() bool
})
if ok && !terr.Temporary() {
return nil, err
}
@ -384,13 +385,13 @@ type ClientConn struct {
csMgr *connectivityStateManager
balancerBuildOpts balancer.BuildOptions
resolverWrapper *ccResolverWrapper
blockingpicker *pickerWrapper
mu sync.RWMutex
sc ServiceConfig
scRaw string
conns map[*addrConn]struct{}
mu sync.RWMutex
resolverWrapper *ccResolverWrapper
sc ServiceConfig
scRaw string
conns map[*addrConn]struct{}
// Keepalive parameter can be updated if a GoAway is received.
mkp keepalive.ClientParameters
curBalancerName string
@ -399,6 +400,8 @@ type ClientConn struct {
balancerWrapper *ccBalancerWrapper
retryThrottler atomic.Value
firstResolveEvent *grpcsync.Event
channelzID int64 // channelz unique identification number
czData *channelzData
}
@ -444,6 +447,25 @@ func (cc *ClientConn) scWatcher() {
}
}
// waitForResolvedAddrs blocks until the resolver has provided addresses or the
// context expires. Returns nil unless the context expires first; otherwise
// returns a status error based on the context.
func (cc *ClientConn) waitForResolvedAddrs(ctx context.Context) error {
// This is on the RPC path, so we use a fast path to avoid the
// more-expensive "select" below after the resolver has returned once.
if cc.firstResolveEvent.HasFired() {
return nil
}
select {
case <-cc.firstResolveEvent.Done():
return nil
case <-ctx.Done():
return status.FromContextError(ctx.Err()).Err()
case <-cc.ctx.Done():
return ErrClientConnClosing
}
}
func (cc *ClientConn) handleResolvedAddrs(addrs []resolver.Address, err error) {
cc.mu.Lock()
defer cc.mu.Unlock()
@ -457,6 +479,7 @@ func (cc *ClientConn) handleResolvedAddrs(addrs []resolver.Address, err error) {
}
cc.curAddresses = addrs
cc.firstResolveEvent.Fire()
if cc.dopts.balancerBuilder == nil {
// Only look at balancer types and switch balancer if balancer dial
@ -715,6 +738,12 @@ func (cc *ClientConn) GetMethodConfig(method string) MethodConfig {
return m
}
func (cc *ClientConn) healthCheckConfig() *healthCheckConfig {
cc.mu.RLock()
defer cc.mu.RUnlock()
return cc.sc.healthCheckConfig
}
func (cc *ClientConn) getTransport(ctx context.Context, failfast bool, method string) (transport.ClientTransport, func(balancer.DoneInfo), error) {
hdr, _ := metadata.FromOutgoingContext(ctx)
t, done, err := cc.blockingpicker.pick(ctx, failfast, balancer.PickOptions{
@ -877,6 +906,10 @@ type addrConn struct {
acbw balancer.SubConn
scopts balancer.NewSubConnOptions
// transport is set when there's a viable transport (note: ac state may not be READY as LB channel
// health checking may require server to report healthy to set ac to READY), and is reset
// to nil when the current transport should no longer be used to create a stream (e.g. after GoAway
// is received, transport is closed, ac has been torn down).
transport transport.ClientTransport // The current transport.
mu sync.Mutex
@ -903,6 +936,8 @@ type addrConn struct {
czData *channelzData
successfulHandshake bool
healthCheckEnabled bool
}
// Note: this requires a lock on ac.mu.
@ -956,6 +991,8 @@ func (ac *addrConn) resetTransport(resolveNow bool) {
return
}
// The transport that was used before is no longer viable.
ac.transport = nil
// If the connection is READY, a failure must have occurred.
// Otherwise, we'll consider this is a transient failure when:
// We've exhausted all addresses
@ -1044,7 +1081,10 @@ func (ac *addrConn) createTransport(backoffNum int, addr resolver.Address, copts
var serverPrefaceReceived bool
var clientPrefaceWrote bool
hcCtx, hcCancel := context.WithCancel(ac.ctx)
onGoAway := func(r transport.GoAwayReason) {
hcCancel()
ac.mu.Lock()
ac.adjustParams(r)
ac.mu.Unlock()
@ -1059,6 +1099,7 @@ func (ac *addrConn) createTransport(backoffNum int, addr resolver.Address, copts
prefaceTimer := time.NewTimer(connectDeadline.Sub(time.Now()))
onClose := func() {
hcCancel()
close(onCloseCalled)
prefaceTimer.Stop()
@ -1087,18 +1128,14 @@ func (ac *addrConn) createTransport(backoffNum int, addr resolver.Address, copts
serverPrefaceReceived = true
if clientPrefaceWrote {
ac.successfulHandshake = true
ac.backoffDeadline = time.Time{}
ac.connectDeadline = time.Time{}
ac.addrIdx = 0
ac.backoffIdx = 0
}
prefaceMu.Unlock()
ac.mu.Unlock()
}
// Do not cancel in the success path because of this issue in Go1.6: https://github.com/golang/go/issues/15078.
connectCtx, cancel := context.WithDeadline(ac.ctx, connectDeadline)
defer cancel()
if channelz.IsOn() {
copts.ChannelzParentID = ac.channelzID
}
@ -1108,12 +1145,12 @@ func (ac *addrConn) createTransport(backoffNum int, addr resolver.Address, copts
if err == nil {
prefaceMu.Lock()
clientPrefaceWrote = true
if serverPrefaceReceived {
if serverPrefaceReceived || ac.dopts.reqHandshake == envconfig.RequireHandshakeOff {
ac.successfulHandshake = true
}
prefaceMu.Unlock()
if ac.dopts.waitForHandshake {
if ac.dopts.reqHandshake == envconfig.RequireHandshakeOn {
select {
case <-prefaceTimer.C:
// We didn't get the preface in time.
@ -1126,7 +1163,7 @@ func (ac *addrConn) createTransport(backoffNum int, addr resolver.Address, copts
close(allowedToReset)
return nil
}
} else {
} else if ac.dopts.reqHandshake == envconfig.RequireHandshakeHybrid {
go func() {
select {
case <-prefaceTimer.C:
@ -1143,7 +1180,6 @@ func (ac *addrConn) createTransport(backoffNum int, addr resolver.Address, copts
if err != nil {
// newTr is either nil, or closed.
cancel()
ac.cc.blockingpicker.updateConnectionError(err)
ac.mu.Lock()
if ac.state == connectivity.Shutdown {
@ -1166,22 +1202,46 @@ func (ac *addrConn) createTransport(backoffNum int, addr resolver.Address, copts
return err
}
// Now there is a viable transport to be use, so set ac.transport to reflect the new viable transport.
ac.mu.Lock()
if ac.state == connectivity.Shutdown {
ac.mu.Unlock()
close(skipReset)
newTr.Close()
return nil
}
ac.transport = newTr
ac.mu.Unlock()
healthCheckConfig := ac.cc.healthCheckConfig()
// LB channel health checking is only enabled when all the four requirements below are met:
// 1. it is not disabled by the user with the WithDisableHealthCheck DialOption,
// 2. the internal.HealthCheckFunc is set by importing the grpc/healthcheck package,
// 3. a service config with non-empty healthCheckConfig field is provided,
// 4. the current load balancer allows it.
if !ac.cc.dopts.disableHealthCheck && healthCheckConfig != nil && ac.scopts.HealthCheckEnabled {
if internal.HealthCheckFunc != nil {
go ac.startHealthCheck(hcCtx, newTr, addr, healthCheckConfig.ServiceName)
close(allowedToReset)
return nil
}
// TODO: add a link to the health check doc in the error message.
grpclog.Error("the client side LB channel health check function has not been set.")
}
// No LB channel health check case
ac.mu.Lock()
if ac.state == connectivity.Shutdown {
ac.mu.Unlock()
// We don't want to reset during this close because we prefer to kick out of this function and let the loop
// in resetTransport take care of reconnecting.
// unblock onGoAway/onClose callback.
close(skipReset)
newTr.Close()
return errConnClosing
}
ac.updateConnectivityState(connectivity.Ready)
ac.cc.handleSubConnStateChange(ac.acbw, ac.state)
ac.transport = newTr
ac.curAddr = addr
ac.mu.Unlock()
@ -1192,6 +1252,51 @@ func (ac *addrConn) createTransport(backoffNum int, addr resolver.Address, copts
return nil
}
func (ac *addrConn) startHealthCheck(ctx context.Context, newTr transport.ClientTransport, addr resolver.Address, serviceName string) {
// Set up the health check helper functions
newStream := func() (interface{}, error) {
return ac.newClientStream(ctx, &StreamDesc{ServerStreams: true}, "/grpc.health.v1.Health/Watch", newTr)
}
firstReady := true
reportHealth := func(ok bool) {
ac.mu.Lock()
defer ac.mu.Unlock()
if ac.transport != newTr {
return
}
if ok {
if firstReady {
firstReady = false
ac.curAddr = addr
}
if ac.state != connectivity.Ready {
ac.updateConnectivityState(connectivity.Ready)
ac.cc.handleSubConnStateChange(ac.acbw, ac.state)
}
} else {
if ac.state != connectivity.TransientFailure {
ac.updateConnectivityState(connectivity.TransientFailure)
ac.cc.handleSubConnStateChange(ac.acbw, ac.state)
}
}
}
err := internal.HealthCheckFunc(ctx, newStream, reportHealth, serviceName)
if err != nil {
if status.Code(err) == codes.Unimplemented {
if channelz.IsOn() {
channelz.AddTraceEvent(ac.channelzID, &channelz.TraceEventDesc{
Desc: "Subchannel health check is unimplemented at server side, thus health check is disabled",
Severity: channelz.CtError,
})
}
grpclog.Error("Subchannel health check is unimplemented at server side, thus health check is disabled")
} else {
grpclog.Errorf("HealthCheckFunc exits with unexpected error %v", err)
}
}
}
// nextAddr increments the addrIdx if there are more addresses to try. If
// there are no more addrs to try it will re-resolve, set addrIdx to 0, and
// increment the backoffIdx.
@ -1200,11 +1305,14 @@ func (ac *addrConn) createTransport(backoffNum int, addr resolver.Address, copts
func (ac *addrConn) nextAddr() error {
ac.mu.Lock()
// If a handshake has been observed, we expect the counters to have manually
// been reset so we'll just return, since we want the next usage to start
// at index 0.
// If a handshake has been observed, we want the next usage to start at
// index 0 immediately.
if ac.successfulHandshake {
ac.successfulHandshake = false
ac.backoffDeadline = time.Time{}
ac.connectDeadline = time.Time{}
ac.addrIdx = 0
ac.backoffIdx = 0
ac.mu.Unlock()
return nil
}
@ -1279,6 +1387,8 @@ func (ac *addrConn) tearDown(err error) {
ac.mu.Unlock()
return
}
curTr := ac.transport
ac.transport = nil
// We have to set the state to Shutdown before anything else to prevent races
// between setting the state and logic that waits on context cancelation / etc.
ac.updateConnectivityState(connectivity.Shutdown)
@ -1286,14 +1396,14 @@ func (ac *addrConn) tearDown(err error) {
ac.tearDownErr = err
ac.cc.handleSubConnStateChange(ac.acbw, ac.state)
ac.curAddr = resolver.Address{}
if err == errConnDrain && ac.transport != nil {
if err == errConnDrain && curTr != nil {
// GracefulClose(...) may be executed multiple times when
// i) receiving multiple GoAway frames from the server; or
// ii) there are concurrent name resolver/Balancer triggered
// address removal and GoAway.
// We have to unlock and re-lock here because GracefulClose => Close => onClose, which requires locking ac.mu.
ac.mu.Unlock()
ac.transport.GracefulClose()
curTr.GracefulClose()
ac.mu.Lock()
}
if channelz.IsOn() {

View File

@ -19,13 +19,13 @@
package grpc
import (
"context"
"net"
"sync"
"sync/atomic"
"testing"
"time"
"golang.org/x/net/context"
"golang.org/x/net/http2"
"google.golang.org/grpc/balancer"
"google.golang.org/grpc/connectivity"

View File

@ -19,6 +19,7 @@
package grpc
import (
"context"
"errors"
"fmt"
"math"
@ -27,11 +28,11 @@ import (
"testing"
"time"
"golang.org/x/net/context"
"golang.org/x/net/http2"
"google.golang.org/grpc/connectivity"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/internal/backoff"
"google.golang.org/grpc/internal/envconfig"
"google.golang.org/grpc/internal/leakcheck"
"google.golang.org/grpc/internal/transport"
"google.golang.org/grpc/keepalive"
@ -132,8 +133,85 @@ func TestDialWithMultipleBackendsNotSendingServerPreface(t *testing.T) {
}
}
var allReqHSSettings = []envconfig.RequireHandshakeSetting{
envconfig.RequireHandshakeOff,
envconfig.RequireHandshakeOn,
envconfig.RequireHandshakeHybrid,
}
var reqNoHSSettings = []envconfig.RequireHandshakeSetting{
envconfig.RequireHandshakeOff,
envconfig.RequireHandshakeHybrid,
}
var reqHSBeforeSuccess = []envconfig.RequireHandshakeSetting{
envconfig.RequireHandshakeOn,
envconfig.RequireHandshakeHybrid,
}
func TestDialWaitsForServerSettings(t *testing.T) {
// Restore current setting after test.
old := envconfig.RequireHandshake
defer func() { envconfig.RequireHandshake = old }()
defer leakcheck.Check(t)
// Test with all environment variable settings, which should not impact the
// test case since WithWaitForHandshake has higher priority.
for _, setting := range allReqHSSettings {
envconfig.RequireHandshake = setting
lis, err := net.Listen("tcp", "localhost:0")
if err != nil {
t.Fatalf("Error while listening. Err: %v", err)
}
defer lis.Close()
done := make(chan struct{})
sent := make(chan struct{})
dialDone := make(chan struct{})
go func() { // Launch the server.
defer func() {
close(done)
}()
conn, err := lis.Accept()
if err != nil {
t.Errorf("Error while accepting. Err: %v", err)
return
}
defer conn.Close()
// Sleep for a little bit to make sure that Dial on client
// side blocks until settings are received.
time.Sleep(100 * time.Millisecond)
framer := http2.NewFramer(conn, conn)
close(sent)
if err := framer.WriteSettings(http2.Setting{}); err != nil {
t.Errorf("Error while writing settings. Err: %v", err)
return
}
<-dialDone // Close conn only after dial returns.
}()
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
client, err := DialContext(ctx, lis.Addr().String(), WithInsecure(), WithWaitForHandshake(), WithBlock())
close(dialDone)
if err != nil {
t.Fatalf("Error while dialing. Err: %v", err)
}
defer client.Close()
select {
case <-sent:
default:
t.Fatalf("Dial returned before server settings were sent")
}
<-done
}
}
func TestDialWaitsForServerSettingsViaEnv(t *testing.T) {
// Set default behavior and restore current setting after test.
old := envconfig.RequireHandshake
envconfig.RequireHandshake = envconfig.RequireHandshakeOn
defer func() { envconfig.RequireHandshake = old }()
defer leakcheck.Check(t)
lis, err := net.Listen("tcp", "localhost:0")
if err != nil {
t.Fatalf("Error while listening. Err: %v", err)
@ -154,7 +232,7 @@ func TestDialWaitsForServerSettings(t *testing.T) {
defer conn.Close()
// Sleep for a little bit to make sure that Dial on client
// side blocks until settings are received.
time.Sleep(500 * time.Millisecond)
time.Sleep(100 * time.Millisecond)
framer := http2.NewFramer(conn, conn)
close(sent)
if err := framer.WriteSettings(http2.Setting{}); err != nil {
@ -165,7 +243,7 @@ func TestDialWaitsForServerSettings(t *testing.T) {
}()
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
client, err := DialContext(ctx, lis.Addr().String(), WithInsecure(), WithWaitForHandshake(), WithBlock())
client, err := DialContext(ctx, lis.Addr().String(), WithInsecure(), WithBlock())
close(dialDone)
if err != nil {
t.Fatalf("Error while dialing. Err: %v", err)
@ -177,11 +255,63 @@ func TestDialWaitsForServerSettings(t *testing.T) {
t.Fatalf("Dial returned before server settings were sent")
}
<-done
}
func TestDialWaitsForServerSettingsAndFails(t *testing.T) {
// Restore current setting after test.
old := envconfig.RequireHandshake
defer func() { envconfig.RequireHandshake = old }()
defer leakcheck.Check(t)
for _, setting := range allReqHSSettings {
envconfig.RequireHandshake = setting
lis, err := net.Listen("tcp", "localhost:0")
if err != nil {
t.Fatalf("Error while listening. Err: %v", err)
}
done := make(chan struct{})
numConns := 0
go func() { // Launch the server.
defer func() {
close(done)
}()
for {
conn, err := lis.Accept()
if err != nil {
break
}
numConns++
defer conn.Close()
}
}()
getMinConnectTimeout = func() time.Duration { return time.Second / 4 }
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
defer cancel()
client, err := DialContext(ctx, lis.Addr().String(), WithInsecure(), WithWaitForHandshake(), WithBlock(), withBackoff(noBackoff{}))
lis.Close()
if err == nil {
client.Close()
t.Fatalf("Unexpected success (err=nil) while dialing")
}
if err != context.DeadlineExceeded {
t.Fatalf("DialContext(_) = %v; want context.DeadlineExceeded", err)
}
if numConns < 2 {
t.Fatalf("dial attempts: %v; want > 1", numConns)
}
<-done
}
}
func TestDialWaitsForServerSettingsViaEnvAndFails(t *testing.T) {
// Set default behavior and restore current setting after test.
old := envconfig.RequireHandshake
envconfig.RequireHandshake = envconfig.RequireHandshakeOn
defer func() { envconfig.RequireHandshake = old }()
defer leakcheck.Check(t)
lis, err := net.Listen("tcp", "localhost:0")
if err != nil {
t.Fatalf("Error while listening. Err: %v", err)
@ -201,10 +331,10 @@ func TestDialWaitsForServerSettingsAndFails(t *testing.T) {
defer conn.Close()
}
}()
getMinConnectTimeout = func() time.Duration { return time.Second / 2 }
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
getMinConnectTimeout = func() time.Duration { return time.Second / 4 }
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
defer cancel()
client, err := DialContext(ctx, lis.Addr().String(), WithInsecure(), WithWaitForHandshake(), WithBlock())
client, err := DialContext(ctx, lis.Addr().String(), WithInsecure(), WithBlock(), withBackoff(noBackoff{}))
lis.Close()
if err == nil {
client.Close()
@ -219,7 +349,57 @@ func TestDialWaitsForServerSettingsAndFails(t *testing.T) {
<-done
}
func TestDialDoesNotWaitForServerSettings(t *testing.T) {
// Restore current setting after test.
old := envconfig.RequireHandshake
defer func() { envconfig.RequireHandshake = old }()
defer leakcheck.Check(t)
// Test with "off" and "hybrid".
for _, setting := range reqNoHSSettings {
envconfig.RequireHandshake = setting
lis, err := net.Listen("tcp", "localhost:0")
if err != nil {
t.Fatalf("Error while listening. Err: %v", err)
}
defer lis.Close()
done := make(chan struct{})
dialDone := make(chan struct{})
go func() { // Launch the server.
defer func() {
close(done)
}()
conn, err := lis.Accept()
if err != nil {
t.Errorf("Error while accepting. Err: %v", err)
return
}
defer conn.Close()
<-dialDone // Close conn only after dial returns.
}()
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
client, err := DialContext(ctx, lis.Addr().String(), WithInsecure(), WithBlock())
if err != nil {
t.Fatalf("DialContext returned err =%v; want nil", err)
}
defer client.Close()
if state := client.GetState(); state != connectivity.Ready {
t.Fatalf("client.GetState() = %v; want connectivity.Ready", state)
}
close(dialDone)
<-done
}
}
func TestCloseConnectionWhenServerPrefaceNotReceived(t *testing.T) {
// Restore current setting after test.
old := envconfig.RequireHandshake
defer func() { envconfig.RequireHandshake = old }()
// 1. Client connects to a server that doesn't send preface.
// 2. After minConnectTimeout(500 ms here), client disconnects and retries.
// 3. The new server sends its preface.
@ -230,75 +410,81 @@ func TestCloseConnectionWhenServerPrefaceNotReceived(t *testing.T) {
}()
defer leakcheck.Check(t)
atomic.StoreInt64((*int64)(&mutableMinConnectTimeout), int64(time.Millisecond)*500)
lis, err := net.Listen("tcp", "localhost:0")
if err != nil {
t.Fatalf("Error while listening. Err: %v", err)
}
var (
conn2 net.Conn
over uint32
)
defer func() {
lis.Close()
// conn2 shouldn't be closed until the client has
// observed a successful test.
if conn2 != nil {
conn2.Close()
}
}()
done := make(chan struct{})
accepted := make(chan struct{})
go func() { // Launch the server.
defer close(done)
conn1, err := lis.Accept()
// Test with "on" and "hybrid".
for _, setting := range reqHSBeforeSuccess {
envconfig.RequireHandshake = setting
lis, err := net.Listen("tcp", "localhost:0")
if err != nil {
t.Errorf("Error while accepting. Err: %v", err)
return
t.Fatalf("Error while listening. Err: %v", err)
}
defer conn1.Close()
// Don't send server settings and the client should close the connection and try again.
conn2, err = lis.Accept() // Accept a reconnection request from client.
if err != nil {
t.Errorf("Error while accepting. Err: %v", err)
return
}
close(accepted)
framer := http2.NewFramer(conn2, conn2)
if err = framer.WriteSettings(http2.Setting{}); err != nil {
t.Errorf("Error while writing settings. Err: %v", err)
return
}
b := make([]byte, 8)
for {
_, err = conn2.Read(b)
if err == nil {
continue
var (
conn2 net.Conn
over uint32
)
defer func() {
lis.Close()
// conn2 shouldn't be closed until the client has
// observed a successful test.
if conn2 != nil {
conn2.Close()
}
if atomic.LoadUint32(&over) == 1 {
// The connection stayed alive for the timer.
// Success.
}()
done := make(chan struct{})
accepted := make(chan struct{})
go func() { // Launch the server.
defer close(done)
conn1, err := lis.Accept()
if err != nil {
t.Errorf("Error while accepting. Err: %v", err)
return
}
t.Errorf("Unexpected error while reading. Err: %v, want timeout error", err)
break
defer conn1.Close()
// Don't send server settings and the client should close the connection and try again.
conn2, err = lis.Accept() // Accept a reconnection request from client.
if err != nil {
t.Errorf("Error while accepting. Err: %v", err)
return
}
close(accepted)
framer := http2.NewFramer(conn2, conn2)
if err = framer.WriteSettings(http2.Setting{}); err != nil {
t.Errorf("Error while writing settings. Err: %v", err)
return
}
b := make([]byte, 8)
for {
_, err = conn2.Read(b)
if err == nil {
continue
}
if atomic.LoadUint32(&over) == 1 {
// The connection stayed alive for the timer.
// Success.
return
}
t.Errorf("Unexpected error while reading. Err: %v, want timeout error", err)
break
}
}()
client, err := Dial(lis.Addr().String(), WithInsecure())
if err != nil {
t.Fatalf("Error while dialing. Err: %v", err)
}
}()
client, err := Dial(lis.Addr().String(), WithInsecure())
if err != nil {
t.Fatalf("Error while dialing. Err: %v", err)
// wait for connection to be accepted on the server.
timer := time.NewTimer(time.Second * 10)
select {
case <-accepted:
case <-timer.C:
t.Fatalf("Client didn't make another connection request in time.")
}
// Make sure the connection stays alive for sometime.
time.Sleep(time.Second)
atomic.StoreUint32(&over, 1)
client.Close()
<-done
}
// wait for connection to be accepted on the server.
timer := time.NewTimer(time.Second * 10)
select {
case <-accepted:
case <-timer.C:
t.Fatalf("Client didn't make another connection request in time.")
}
// Make sure the connection stays alive for sometime.
time.Sleep(time.Second * 2)
atomic.StoreUint32(&over, 1)
client.Close()
<-done
}
func TestBackoffWhenNoServerPrefaceReceived(t *testing.T) {
@ -727,7 +913,7 @@ func TestClientUpdatesParamsAfterGoAway(t *testing.T) {
t.Fatalf("Dial(%s, _) = _, %v, want _, <nil>", addr, err)
}
defer cc.Close()
time.Sleep(1 * time.Second)
time.Sleep(time.Second)
cc.mu.RLock()
defer cc.mu.RUnlock()
v := cc.mkp.Time
@ -758,7 +944,7 @@ func TestDisableServiceConfigOption(t *testing.T) {
}
]
}`)
time.Sleep(1 * time.Second)
time.Sleep(time.Second)
m := cc.GetMethodConfig("/foo/Bar")
if m.WaitForReady != nil {
t.Fatalf("want: method (\"/foo/bar/\") config to be empty, got: %v", m)

View File

@ -22,7 +22,8 @@
package connectivity
import (
"golang.org/x/net/context"
"context"
"google.golang.org/grpc/grpclog"
)

View File

@ -24,13 +24,13 @@
package alts
import (
"context"
"errors"
"fmt"
"net"
"sync"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc/credentials"
core "google.golang.org/grpc/credentials/alts/internal"
"google.golang.org/grpc/credentials/alts/internal/handshaker"

View File

@ -22,9 +22,9 @@
package internal
import (
"context"
"net"
"golang.org/x/net/context"
"google.golang.org/grpc/credentials"
)

View File

@ -20,13 +20,13 @@
package handshaker
import (
"context"
"errors"
"fmt"
"io"
"net"
"sync"
"golang.org/x/net/context"
grpc "google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"

View File

@ -20,10 +20,10 @@ package handshaker
import (
"bytes"
"context"
"testing"
"time"
"golang.org/x/net/context"
grpc "google.golang.org/grpc"
core "google.golang.org/grpc/credentials/alts/internal"
altspb "google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp"

View File

@ -19,6 +19,7 @@
package alts
import (
"context"
"errors"
"fmt"
"io"
@ -30,7 +31,6 @@ import (
"runtime"
"strings"
"golang.org/x/net/context"
"google.golang.org/grpc/peer"
)

View File

@ -19,11 +19,11 @@
package alts
import (
"context"
"io"
"strings"
"testing"
"golang.org/x/net/context"
altspb "google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp"
"google.golang.org/grpc/peer"
)

View File

@ -23,6 +23,7 @@
package credentials // import "google.golang.org/grpc/credentials"
import (
"context"
"crypto/tls"
"crypto/x509"
"errors"
@ -32,7 +33,7 @@ import (
"strings"
"github.com/golang/protobuf/proto"
"golang.org/x/net/context"
"google.golang.org/grpc/credentials/internal"
)
// alpnProtoStr are the specified application level protocols for gRPC.
@ -138,8 +139,8 @@ func (t TLSInfo) AuthType() string {
return "tls"
}
// GetChannelzSecurityValue returns security info requested by channelz.
func (t TLSInfo) GetChannelzSecurityValue() ChannelzSecurityValue {
// GetSecurityValue returns security info requested by channelz.
func (t TLSInfo) GetSecurityValue() ChannelzSecurityValue {
v := &TLSChannelzSecurityValue{
StandardName: cipherSuiteLookup[t.State.CipherSuite],
}
@ -187,7 +188,7 @@ func (c *tlsCreds) ClientHandshake(ctx context.Context, authority string, rawCon
case <-ctx.Done():
return nil, nil, ctx.Err()
}
return tlsConn{Conn: conn, rawConn: rawConn}, TLSInfo{conn.ConnectionState()}, nil
return internal.WrapSyscallConn(rawConn, conn), TLSInfo{conn.ConnectionState()}, nil
}
func (c *tlsCreds) ServerHandshake(rawConn net.Conn) (net.Conn, AuthInfo, error) {
@ -195,7 +196,7 @@ func (c *tlsCreds) ServerHandshake(rawConn net.Conn) (net.Conn, AuthInfo, error)
if err := conn.Handshake(); err != nil {
return nil, nil, err
}
return tlsConn{Conn: conn, rawConn: rawConn}, TLSInfo{conn.ConnectionState()}, nil
return internal.WrapSyscallConn(rawConn, conn), TLSInfo{conn.ConnectionState()}, nil
}
func (c *tlsCreds) Clone() TransportCredentials {
@ -285,11 +286,6 @@ type OtherChannelzSecurityValue struct {
func (*OtherChannelzSecurityValue) isChannelzSecurityValue() {}
type tlsConn struct {
*tls.Conn
rawConn net.Conn
}
var cipherSuiteLookup = map[uint16]string{
tls.TLS_RSA_WITH_RC4_128_SHA: "TLS_RSA_WITH_RC4_128_SHA",
tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA: "TLS_RSA_WITH_3DES_EDE_CBC_SHA",
@ -309,4 +305,24 @@ var cipherSuiteLookup = map[uint16]string{
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384: "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
tls.TLS_FALLBACK_SCSV: "TLS_FALLBACK_SCSV",
tls.TLS_RSA_WITH_AES_128_CBC_SHA256: "TLS_RSA_WITH_AES_128_CBC_SHA256",
tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256: "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256",
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256: "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305: "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305",
tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305: "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305",
}
// cloneTLSConfig returns a shallow clone of the exported
// fields of cfg, ignoring the unexported sync.Once, which
// contains a mutex and must not be copied.
//
// If cfg is nil, a new zero tls.Config is returned.
//
// TODO: inline this function if possible.
func cloneTLSConfig(cfg *tls.Config) *tls.Config {
if cfg == nil {
return &tls.Config{}
}
return cfg.Clone()
}

View File

@ -19,11 +19,11 @@
package credentials
import (
"context"
"crypto/tls"
"net"
"testing"
"golang.org/x/net/context"
"google.golang.org/grpc/testdata"
)

View File

@ -1,57 +0,0 @@
// +build !go1.7
/*
*
* Copyright 2016 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package credentials
import (
"crypto/tls"
)
// cloneTLSConfig returns a shallow clone of the exported
// fields of cfg, ignoring the unexported sync.Once, which
// contains a mutex and must not be copied.
//
// If cfg is nil, a new zero tls.Config is returned.
func cloneTLSConfig(cfg *tls.Config) *tls.Config {
if cfg == nil {
return &tls.Config{}
}
return &tls.Config{
Rand: cfg.Rand,
Time: cfg.Time,
Certificates: cfg.Certificates,
NameToCertificate: cfg.NameToCertificate,
GetCertificate: cfg.GetCertificate,
RootCAs: cfg.RootCAs,
NextProtos: cfg.NextProtos,
ServerName: cfg.ServerName,
ClientAuth: cfg.ClientAuth,
ClientCAs: cfg.ClientCAs,
InsecureSkipVerify: cfg.InsecureSkipVerify,
CipherSuites: cfg.CipherSuites,
PreferServerCipherSuites: cfg.PreferServerCipherSuites,
SessionTicketsDisabled: cfg.SessionTicketsDisabled,
SessionTicketKey: cfg.SessionTicketKey,
ClientSessionCache: cfg.ClientSessionCache,
MinVersion: cfg.MinVersion,
MaxVersion: cfg.MaxVersion,
CurvePreferences: cfg.CurvePreferences,
}
}

View File

@ -1,59 +0,0 @@
// +build go1.7,!go1.8
/*
*
* Copyright 2016 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package credentials
import (
"crypto/tls"
)
// cloneTLSConfig returns a shallow clone of the exported
// fields of cfg, ignoring the unexported sync.Once, which
// contains a mutex and must not be copied.
//
// If cfg is nil, a new zero tls.Config is returned.
func cloneTLSConfig(cfg *tls.Config) *tls.Config {
if cfg == nil {
return &tls.Config{}
}
return &tls.Config{
Rand: cfg.Rand,
Time: cfg.Time,
Certificates: cfg.Certificates,
NameToCertificate: cfg.NameToCertificate,
GetCertificate: cfg.GetCertificate,
RootCAs: cfg.RootCAs,
NextProtos: cfg.NextProtos,
ServerName: cfg.ServerName,
ClientAuth: cfg.ClientAuth,
ClientCAs: cfg.ClientCAs,
InsecureSkipVerify: cfg.InsecureSkipVerify,
CipherSuites: cfg.CipherSuites,
PreferServerCipherSuites: cfg.PreferServerCipherSuites,
SessionTicketsDisabled: cfg.SessionTicketsDisabled,
SessionTicketKey: cfg.SessionTicketKey,
ClientSessionCache: cfg.ClientSessionCache,
MinVersion: cfg.MinVersion,
MaxVersion: cfg.MaxVersion,
CurvePreferences: cfg.CurvePreferences,
DynamicRecordSizingDisabled: cfg.DynamicRecordSizingDisabled,
Renegotiation: cfg.Renegotiation,
}
}

View File

@ -1,46 +0,0 @@
// +build go1.8
/*
*
* Copyright 2017 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package credentials
import (
"crypto/tls"
)
func init() {
cipherSuiteLookup[tls.TLS_RSA_WITH_AES_128_CBC_SHA256] = "TLS_RSA_WITH_AES_128_CBC_SHA256"
cipherSuiteLookup[tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256] = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256"
cipherSuiteLookup[tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256] = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"
cipherSuiteLookup[tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305] = "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305"
cipherSuiteLookup[tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305] = "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305"
}
// cloneTLSConfig returns a shallow clone of the exported
// fields of cfg, ignoring the unexported sync.Once, which
// contains a mutex and must not be copied.
//
// If cfg is nil, a new zero tls.Config is returned.
func cloneTLSConfig(cfg *tls.Config) *tls.Config {
if cfg == nil {
return &tls.Config{}
}
return cfg.Clone()
}

View File

@ -1,35 +0,0 @@
// +build go1.9,!appengine
/*
*
* Copyright 2018 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package credentials
import (
"errors"
"syscall"
)
// implements the syscall.Conn interface
func (c tlsConn) SyscallConn() (syscall.RawConn, error) {
conn, ok := c.rawConn.(syscall.Conn)
if !ok {
return nil, errors.New("RawConn does not implement syscall.Conn")
}
return conn.SyscallConn()
}

View File

@ -20,10 +20,10 @@
package google
import (
"context"
"fmt"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/alts"
"google.golang.org/grpc/credentials/oauth"

View File

@ -0,0 +1,61 @@
// +build !appengine
/*
*
* Copyright 2018 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// Package internal contains credentials-internal code.
package internal
import (
"net"
"syscall"
)
type sysConn = syscall.Conn
// syscallConn keeps reference of rawConn to support syscall.Conn for channelz.
// SyscallConn() (the method in interface syscall.Conn) is explicitly
// implemented on this type,
//
// Interface syscall.Conn is implemented by most net.Conn implementations (e.g.
// TCPConn, UnixConn), but is not part of net.Conn interface. So wrapper conns
// that embed net.Conn don't implement syscall.Conn. (Side note: tls.Conn
// doesn't embed net.Conn, so even if syscall.Conn is part of net.Conn, it won't
// help here).
type syscallConn struct {
net.Conn
// sysConn is a type alias of syscall.Conn. It's necessary because the name
// `Conn` collides with `net.Conn`.
sysConn
}
// WrapSyscallConn tries to wrap rawConn and newConn into a net.Conn that
// implements syscall.Conn. rawConn will be used to support syscall, and newConn
// will be used for read/write.
//
// This function returns newConn if rawConn doesn't implement syscall.Conn.
func WrapSyscallConn(rawConn, newConn net.Conn) net.Conn {
sysConn, ok := rawConn.(syscall.Conn)
if !ok {
return newConn
}
return &syscallConn{
Conn: newConn,
sysConn: sysConn,
}
}

View File

@ -1,4 +1,4 @@
// +build go1.6, !go1.8
// +build appengine
/*
*
@ -18,10 +18,13 @@
*
*/
package dns
package internal
import (
"fmt"
"net"
)
var errForInvalidTarget = fmt.Errorf("invalid target address [2001:db8:a0b:12f0::1, error info: missing ']' in address [2001:db8:a0b:12f0::1:443")
// WrapSyscallConn returns newConn on appengine.
func WrapSyscallConn(rawConn, newConn net.Conn) net.Conn {
return newConn
}

View File

@ -0,0 +1,64 @@
// +build !appengine
/*
*
* Copyright 2018 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package internal_test
import (
"net"
"syscall"
"testing"
"google.golang.org/grpc/credentials/internal"
)
type syscallConn struct {
net.Conn
}
func (*syscallConn) SyscallConn() (syscall.RawConn, error) {
return nil, nil
}
type nonSyscallConn struct {
net.Conn
}
func TestWrapSyscallConn(t *testing.T) {
sc := &syscallConn{}
nsc := &nonSyscallConn{}
wrapConn := internal.WrapSyscallConn(sc, nsc)
if _, ok := wrapConn.(syscall.Conn); !ok {
t.Errorf("returned conn (type %T) doesn't implement syscall.Conn, want implement", wrapConn)
}
}
func TestWrapSyscallConnNoWrap(t *testing.T) {
nscRaw := &nonSyscallConn{}
nsc := &nonSyscallConn{}
wrapConn := internal.WrapSyscallConn(nscRaw, nsc)
if _, ok := wrapConn.(syscall.Conn); ok {
t.Errorf("returned conn (type %T) implements syscall.Conn, want not implement", wrapConn)
}
if wrapConn != nsc {
t.Errorf("returned conn is %p, want %p (the passed-in newConn)", wrapConn, nsc)
}
}

View File

@ -20,11 +20,11 @@
package oauth
import (
"context"
"fmt"
"io/ioutil"
"sync"
"golang.org/x/net/context"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"golang.org/x/oauth2/jwt"

View File

@ -19,11 +19,11 @@
package grpc
import (
"context"
"fmt"
"net"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc/balancer"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/internal"
@ -55,10 +55,11 @@ type dialOptions struct {
balancerBuilder balancer.Builder
// This is to support grpclb.
resolverBuilder resolver.Builder
waitForHandshake bool
reqHandshake envconfig.RequireHandshakeSetting
channelzParentID int64
disableServiceConfig bool
disableRetry bool
disableHealthCheck bool
}
// DialOption configures how we set up the connection.
@ -91,10 +92,15 @@ func newFuncDialOption(f func(*dialOptions)) *funcDialOption {
}
// WithWaitForHandshake blocks until the initial settings frame is received from
// the server before assigning RPCs to the connection. Experimental API.
// the server before assigning RPCs to the connection.
//
// Deprecated: this will become the default behavior in the 1.17 release, and
// will be removed after the 1.18 release. To override the default behavior in
// the 1.17 release, either use this dial option or set the environment
// variable GRPC_GO_READY_BEFORE_HANDSHAKE=on.
func WithWaitForHandshake() DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.waitForHandshake = true
o.reqHandshake = envconfig.RequireHandshakeOn
})
}
@ -454,9 +460,18 @@ func WithMaxHeaderListSize(s uint32) DialOption {
})
}
// WithDisableHealthCheck disables the LB channel health checking for all SubConns of this ClientConn.
//
// This API is EXPERIMENTAL.
func WithDisableHealthCheck() DialOption {
return newFuncDialOption(func(o *dialOptions) {
o.disableHealthCheck = true
})
}
func defaultDialOptions() dialOptions {
return dialOptions{
disableRetry: !envconfig.Retry,
reqHandshake: envconfig.RequireHandshake,
copts: transport.ConnectOptions{
WriteBufferSize: defaultWriteBufSize,
ReadBufferSize: defaultReadBufSize,

View File

@ -1,5 +1,3 @@
// +build go1.7
/*
*
* Copyright 2014 gRPC authors.

View File

@ -19,11 +19,11 @@
package main
import (
"context"
"log"
"os"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc"
pb "google.golang.org/grpc/examples/helloworld/helloworld"
)

View File

@ -21,10 +21,10 @@
package main
import (
"context"
"log"
"net"
"golang.org/x/net/context"
"google.golang.org/grpc"
pb "google.golang.org/grpc/examples/helloworld/helloworld"
"google.golang.org/grpc/reflection"

View File

@ -19,13 +19,13 @@
package mock_helloworld_test
import (
"context"
"fmt"
"testing"
"time"
"github.com/golang/mock/gomock"
"github.com/golang/protobuf/proto"
"golang.org/x/net/context"
helloworld "google.golang.org/grpc/examples/helloworld/helloworld"
hwmock "google.golang.org/grpc/examples/helloworld/mock_helloworld"
)

View File

@ -20,11 +20,11 @@
package main
import (
"context"
"crypto/tls"
"log"
"time"
"golang.org/x/net/context"
"golang.org/x/oauth2"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"

View File

@ -21,12 +21,12 @@
package main
import (
"context"
"crypto/tls"
"log"
"net"
"strings"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"

View File

@ -23,13 +23,13 @@
package main
import (
"context"
"flag"
"io"
"log"
"math/rand"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
pb "google.golang.org/grpc/examples/route_guide/routeguide"

View File

@ -19,13 +19,13 @@
package mock_routeguide_test
import (
"context"
"fmt"
"testing"
"time"
"github.com/golang/mock/gomock"
"github.com/golang/protobuf/proto"
"golang.org/x/net/context"
rgmock "google.golang.org/grpc/examples/route_guide/mock_routeguide"
rgpb "google.golang.org/grpc/examples/route_guide/routeguide"
)

View File

@ -25,6 +25,7 @@
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
@ -36,7 +37,6 @@ import (
"sync"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"

View File

@ -19,11 +19,11 @@
package main
import (
"context"
"log"
"os"
"time"
"golang.org/x/net/context"
epb "google.golang.org/genproto/googleapis/rpc/errdetails"
"google.golang.org/grpc"
pb "google.golang.org/grpc/examples/helloworld/helloworld"

View File

@ -19,12 +19,12 @@
package main
import (
"context"
"fmt"
"log"
"net"
"sync"
"golang.org/x/net/context"
epb "google.golang.org/genproto/googleapis/rpc/errdetails"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"

View File

@ -4,11 +4,10 @@ require (
cloud.google.com/go v0.26.0 // indirect
github.com/client9/misspell v0.3.4
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7
github.com/golang/mock v1.1.1
github.com/golang/protobuf v1.2.0
github.com/kisielk/gotool v1.0.0 // indirect
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7 // indirect
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f // indirect

View File

@ -4,16 +4,14 @@ github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJ
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7 h1:2hRPrmiwPrp3fQX967rNJIhQPtiGXdlQWAxKbKw3VHA=
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7 h1:00BeQWmeaGazuOrq8Q5K5d3/cHaGuFrZzpaHBXfrsUA=
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3 h1:x/bBzNauLQAlE3fLku/xy92Y8QwKX5HZymrMz2IiKFc=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d h1:g9qWBGx4puODJTMVyoPrpoxPFgVGd+z1DZwjfRu4d0I=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs=

View File

@ -1,71 +0,0 @@
// +build go1.6,!go1.7
/*
*
* Copyright 2016 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package grpc
import (
"fmt"
"io"
"net"
"net/http"
"golang.org/x/net/context"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/internal/transport"
"google.golang.org/grpc/status"
)
// dialContext connects to the address on the named network.
func dialContext(ctx context.Context, network, address string) (net.Conn, error) {
return (&net.Dialer{Cancel: ctx.Done()}).Dial(network, address)
}
func sendHTTPRequest(ctx context.Context, req *http.Request, conn net.Conn) error {
req.Cancel = ctx.Done()
if err := req.Write(conn); err != nil {
return fmt.Errorf("failed to write the HTTP request: %v", err)
}
return nil
}
// toRPCErr converts an error into an error from the status package.
func toRPCErr(err error) error {
if err == nil || err == io.EOF {
return err
}
if err == io.ErrUnexpectedEOF {
return status.Error(codes.Internal, err.Error())
}
if _, ok := status.FromError(err); ok {
return err
}
switch e := err.(type) {
case transport.ConnectionError:
return status.Error(codes.Unavailable, e.Desc)
default:
switch err {
case context.DeadlineExceeded:
return status.Error(codes.DeadlineExceeded, err.Error())
case context.Canceled:
return status.Error(codes.Canceled, err.Error())
}
}
return status.Error(codes.Unknown, err.Error())
}

View File

@ -1,72 +0,0 @@
// +build go1.7
/*
*
* Copyright 2016 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package grpc
import (
"context"
"fmt"
"io"
"net"
"net/http"
netctx "golang.org/x/net/context"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/internal/transport"
"google.golang.org/grpc/status"
)
// dialContext connects to the address on the named network.
func dialContext(ctx context.Context, network, address string) (net.Conn, error) {
return (&net.Dialer{}).DialContext(ctx, network, address)
}
func sendHTTPRequest(ctx context.Context, req *http.Request, conn net.Conn) error {
req = req.WithContext(ctx)
if err := req.Write(conn); err != nil {
return fmt.Errorf("failed to write the HTTP request: %v", err)
}
return nil
}
// toRPCErr converts an error into an error from the status package.
func toRPCErr(err error) error {
if err == nil || err == io.EOF {
return err
}
if err == io.ErrUnexpectedEOF {
return status.Error(codes.Internal, err.Error())
}
if _, ok := status.FromError(err); ok {
return err
}
switch e := err.(type) {
case transport.ConnectionError:
return status.Error(codes.Unavailable, e.Desc)
default:
switch err {
case context.DeadlineExceeded, netctx.DeadlineExceeded:
return status.Error(codes.DeadlineExceeded, err.Error())
case context.Canceled, netctx.Canceled:
return status.Error(codes.Canceled, err.Error())
}
}
return status.Error(codes.Unknown, err.Error())
}

107
vendor/google.golang.org/grpc/health/client.go generated vendored Normal file
View File

@ -0,0 +1,107 @@
/*
*
* Copyright 2018 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package health
import (
"context"
"fmt"
"io"
"time"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
healthpb "google.golang.org/grpc/health/grpc_health_v1"
"google.golang.org/grpc/internal"
"google.golang.org/grpc/internal/backoff"
"google.golang.org/grpc/status"
)
const maxDelay = 120 * time.Second
var backoffStrategy = backoff.Exponential{MaxDelay: maxDelay}
var backoffFunc = func(ctx context.Context, retries int) bool {
d := backoffStrategy.Backoff(retries)
timer := time.NewTimer(d)
select {
case <-timer.C:
return true
case <-ctx.Done():
timer.Stop()
return false
}
}
func init() {
internal.HealthCheckFunc = clientHealthCheck
}
func clientHealthCheck(ctx context.Context, newStream func() (interface{}, error), reportHealth func(bool), service string) error {
tryCnt := 0
retryConnection:
for {
// Backs off if the connection has failed in some way without receiving a message in the previous retry.
if tryCnt > 0 && !backoffFunc(ctx, tryCnt-1) {
return nil
}
tryCnt++
if ctx.Err() != nil {
return nil
}
rawS, err := newStream()
if err != nil {
continue retryConnection
}
s, ok := rawS.(grpc.ClientStream)
// Ideally, this should never happen. But if it happens, the server is marked as healthy for LBing purposes.
if !ok {
reportHealth(true)
return fmt.Errorf("newStream returned %v (type %T); want grpc.ClientStream", rawS, rawS)
}
if err = s.SendMsg(&healthpb.HealthCheckRequest{Service: service}); err != nil && err != io.EOF {
// Stream should have been closed, so we can safely continue to create a new stream.
continue retryConnection
}
s.CloseSend()
resp := new(healthpb.HealthCheckResponse)
for {
err = s.RecvMsg(resp)
// Reports healthy for the LBing purposes if health check is not implemented in the server.
if status.Code(err) == codes.Unimplemented {
reportHealth(true)
return err
}
// Reports unhealthy if server's Watch method gives an error other than UNIMPLEMENTED.
if err != nil {
reportHealth(false)
continue retryConnection
}
// As a message has been received, removes the need for backoff for the next retry by reseting the try count.
tryCnt = 0
reportHealth(resp.Status == healthpb.HealthCheckResponse_SERVING)
}
}
}

57
vendor/google.golang.org/grpc/health/client_test.go generated vendored Normal file
View File

@ -0,0 +1,57 @@
/*
*
* Copyright 2018 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package health
import (
"context"
"errors"
"reflect"
"testing"
"time"
)
func TestClientHealthCheckBackoff(t *testing.T) {
const maxRetries = 5
var want []time.Duration
for i := 0; i < maxRetries; i++ {
want = append(want, time.Duration(i+1)*time.Second)
}
var got []time.Duration
newStream := func() (interface{}, error) {
if len(got) < maxRetries {
return nil, errors.New("backoff")
}
return nil, nil
}
oldBackoffFunc := backoffFunc
backoffFunc = func(ctx context.Context, retries int) bool {
got = append(got, time.Duration(retries+1)*time.Second)
return true
}
defer func() { backoffFunc = oldBackoffFunc }()
clientHealthCheck(context.Background(), newStream, func(_ bool) {}, "test")
if !reflect.DeepEqual(got, want) {
t.Fatalf("Backoff durations for %v retries are %v. (expected: %v)", maxRetries, got, want)
}
}

View File

@ -18,15 +18,16 @@
//go:generate ./regenerate.sh
// Package health provides some utility functions to health-check a server. The implementation
// is based on protobuf. Users need to write their own implementations if other IDLs are used.
// Package health provides a service that exposes server's health and it must be
// imported to enable support for client-side health checks.
package health
import (
"context"
"sync"
"golang.org/x/net/context"
"google.golang.org/grpc/codes"
healthgrpc "google.golang.org/grpc/health/grpc_health_v1"
healthpb "google.golang.org/grpc/health/grpc_health_v1"
"google.golang.org/grpc/status"
)
@ -36,14 +37,14 @@ type Server struct {
mu sync.Mutex
// statusMap stores the serving status of the services this Server monitors.
statusMap map[string]healthpb.HealthCheckResponse_ServingStatus
updates map[string]map[healthpb.Health_WatchServer]chan healthpb.HealthCheckResponse_ServingStatus
updates map[string]map[healthgrpc.Health_WatchServer]chan healthpb.HealthCheckResponse_ServingStatus
}
// NewServer returns a new Server.
func NewServer() *Server {
return &Server{
statusMap: map[string]healthpb.HealthCheckResponse_ServingStatus{"": healthpb.HealthCheckResponse_SERVING},
updates: make(map[string]map[healthpb.Health_WatchServer]chan healthpb.HealthCheckResponse_ServingStatus),
updates: make(map[string]map[healthgrpc.Health_WatchServer]chan healthpb.HealthCheckResponse_ServingStatus),
}
}
@ -60,7 +61,7 @@ func (s *Server) Check(ctx context.Context, in *healthpb.HealthCheckRequest) (*h
}
// Watch implements `service Health`.
func (s *Server) Watch(in *healthpb.HealthCheckRequest, stream healthpb.Health_WatchServer) error {
func (s *Server) Watch(in *healthpb.HealthCheckRequest, stream healthgrpc.Health_WatchServer) error {
service := in.Service
// update channel is used for getting service status updates.
update := make(chan healthpb.HealthCheckResponse_ServingStatus, 1)
@ -74,7 +75,7 @@ func (s *Server) Watch(in *healthpb.HealthCheckRequest, stream healthpb.Health_W
// Registers the update channel to the correct place in the updates map.
if _, ok := s.updates[service]; !ok {
s.updates[service] = make(map[healthpb.Health_WatchServer]chan healthpb.HealthCheckResponse_ServingStatus)
s.updates[service] = make(map[healthgrpc.Health_WatchServer]chan healthpb.HealthCheckResponse_ServingStatus)
}
s.updates[service][stream] = update
defer func() {
@ -83,10 +84,16 @@ func (s *Server) Watch(in *healthpb.HealthCheckRequest, stream healthpb.Health_W
s.mu.Unlock()
}()
s.mu.Unlock()
var lastSentStatus healthpb.HealthCheckResponse_ServingStatus = -1
for {
select {
// Status updated. Sends the up-to-date status to the client.
case servingStatus := <-update:
if lastSentStatus == servingStatus {
continue
}
lastSentStatus = servingStatus
err := stream.Send(&healthpb.HealthCheckResponse{Status: servingStatus})
if err != nil {
return status.Error(codes.Canceled, "Stream has ended.")
@ -102,6 +109,8 @@ func (s *Server) Watch(in *healthpb.HealthCheckRequest, stream healthpb.Health_W
// or insert a new service entry into the statusMap.
func (s *Server) SetServingStatus(service string, servingStatus healthpb.HealthCheckResponse_ServingStatus) {
s.mu.Lock()
defer s.mu.Unlock()
s.statusMap[service] = servingStatus
for _, update := range s.updates[service] {
// Clears previous updates, that are not sent to the client, from the channel.
@ -113,5 +122,4 @@ func (s *Server) SetServingStatus(service string, servingStatus healthpb.HealthC
// Puts the most recent update to the channel.
update <- servingStatus
}
s.mu.Unlock()
}

View File

@ -15,6 +15,7 @@
* limitations under the License.
*
*/
package health_test
import (
@ -22,12 +23,12 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/health"
pb "google.golang.org/grpc/health/grpc_health_v1"
healthgrpc "google.golang.org/grpc/health/grpc_health_v1"
)
// Make sure the service implementation complies with the proto definition.
func TestRegister(t *testing.T) {
s := grpc.NewServer()
pb.RegisterHealthServer(s, health.NewServer())
healthgrpc.RegisterHealthServer(s, health.NewServer())
s.Stop()
}

View File

@ -19,7 +19,7 @@
package grpc
import (
"golang.org/x/net/context"
"context"
)
// UnaryInvoker is called by UnaryClientInterceptor to complete RPCs.

View File

@ -27,16 +27,42 @@ import (
"google.golang.org/grpc/grpclog"
)
// Logger is the global binary logger for the binary. One of this should be
// Logger is the global binary logger. It can be used to get binary logger for
// each method.
type Logger interface {
getMethodLogger(methodName string) *MethodLogger
}
// binLogger is the global binary logger for the binary. One of this should be
// built at init time from the configuration (environment varialbe or flags).
//
// It is used to get a methodLogger for each individual method.
var Logger *logger
var binLogger Logger
// SetLogger sets the binarg logger.
//
// Only call this at init time.
func SetLogger(l Logger) {
binLogger = l
}
// GetMethodLogger returns the methodLogger for the given methodName.
//
// methodName should be in the format of "/service/method".
//
// Each methodLogger returned by this method is a new instance. This is to
// generate sequence id within the call.
func GetMethodLogger(methodName string) *MethodLogger {
if binLogger == nil {
return nil
}
return binLogger.getMethodLogger(methodName)
}
func init() {
const envStr = "GRPC_BINARY_LOG_FILTER"
configStr := os.Getenv(envStr)
Logger = newLoggerFromConfigString(configStr)
binLogger = NewLoggerFromConfigString(configStr)
}
type methodLoggerConfig struct {
@ -113,13 +139,13 @@ func (l *logger) setBlacklist(method string) error {
return nil
}
// GetMethodLogger returns the methodLogger for the given methodName.
// getMethodLogger returns the methodLogger for the given methodName.
//
// methodName should be in the format of "/service/method".
//
// Each methodLogger returned by this method is a new instance. This is to
// generate sequence id within the call.
func (l *logger) GetMethodLogger(methodName string) *MethodLogger {
func (l *logger) getMethodLogger(methodName string) *MethodLogger {
s, m, err := parseMethodName(methodName)
if err != nil {
grpclog.Infof("binarylogging: failed to parse %q: %v", methodName, err)

File diff suppressed because it is too large Load Diff

View File

@ -78,12 +78,12 @@ func TestGetMethodLogger(t *testing.T) {
},
}
for _, tc := range testCases {
l := newLoggerFromConfigString(tc.in)
l := NewLoggerFromConfigString(tc.in)
if l == nil {
t.Errorf("in: %q, failed to create logger from config string", tc.in)
continue
}
ml := l.GetMethodLogger(tc.method)
ml := l.getMethodLogger(tc.method)
if ml == nil {
t.Errorf("in: %q, method logger is nil, want non-nil", tc.in)
continue
@ -134,12 +134,12 @@ func TestGetMethodLoggerOff(t *testing.T) {
},
}
for _, tc := range testCases {
l := newLoggerFromConfigString(tc.in)
l := NewLoggerFromConfigString(tc.in)
if l == nil {
t.Errorf("in: %q, failed to create logger from config string", tc.in)
continue
}
ml := l.GetMethodLogger(tc.method)
ml := l.getMethodLogger(tc.method)
if ml != nil {
t.Errorf("in: %q, method logger is non-nil, want nil", tc.in)
}

View File

@ -0,0 +1,42 @@
/*
*
* Copyright 2018 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// This file contains exported variables/functions that are exported for testing
// only.
//
// An ideal way for this would be to put those in a *_test.go but in binarylog
// package. But this doesn't work with staticcheck with go module. Error was:
// "MdToMetadataProto not declared by package binarylog". This could be caused
// by the way staticcheck looks for files for a certain package, which doesn't
// support *_test.go files.
//
// Move those to binary_test.go when staticcheck is fixed.
package binarylog
var (
// AllLogger is a logger that logs all headers/messages for all RPCs. It's
// for testing only.
AllLogger = NewLoggerFromConfigString("*")
// MdToMetadataProto converts metadata to a binary logging proto message.
// It's for testing only.
MdToMetadataProto = mdToMetadataProto
// AddrToProto converts an address to a binary logging proto message. It's
// for testing only.
AddrToProto = addrToProto
)

View File

@ -28,7 +28,8 @@ import (
"google.golang.org/grpc/grpclog"
)
// newLoggerFromConfigString reads the string and build a logger.
// NewLoggerFromConfigString reads the string and build a logger. It can be used
// to build a new logger and assign it to binarylog.Logger.
//
// Example filter config strings:
// - "" Nothing will be logged
@ -43,7 +44,10 @@ import (
//
// If two configs exist for one certain method or service, the one specified
// later overrides the privous config.
func newLoggerFromConfigString(s string) *logger {
func NewLoggerFromConfigString(s string) Logger {
if s == "" {
return nil
}
l := newEmptyLogger()
methods := strings.Split(s, ",")
for _, method := range methods {

View File

@ -34,7 +34,7 @@ func TestNewLoggerFromConfigString(t *testing.T) {
fullM2 = s1 + "/" + m2
)
c := fmt.Sprintf("*{h:1;m:2},%s{h},%s{m},%s{h;m}", s1+"/*", fullM1, fullM2)
l := newLoggerFromConfigString(c)
l := NewLoggerFromConfigString(c).(*logger)
if l.all.hdr != 1 || l.all.msg != 2 {
t.Errorf("l.all = %#v, want headerLen: 1, messageLen: 2", l.all)
@ -83,7 +83,7 @@ func TestNewLoggerFromConfigStringInvalid(t *testing.T) {
"*,*{h:1;m:1}",
}
for _, tc := range testCases {
l := newLoggerFromConfigString(tc)
l := NewLoggerFromConfigString(tc)
if l != nil {
t.Errorf("With config %q, want logger %v, got %v", tc, nil, l)
}

View File

@ -206,8 +206,8 @@ func (c *ServerHeader) toProto() *pb.GrpcLogEntry {
// ClientMessage configs the binary log entry to be a ClientMessage entry.
type ClientMessage struct {
OnClientSide bool
// Message should only be a proto.Message. Could add support for other
// message types in the future.
// Message can be a proto.Message or []byte. Other messages formats are not
// supported.
Message interface{}
}
@ -246,8 +246,8 @@ func (c *ClientMessage) toProto() *pb.GrpcLogEntry {
// ServerMessage configs the binary log entry to be a ServerMessage entry.
type ServerMessage struct {
OnClientSide bool
// Message should only be a proto.Message. Could add support for other
// message types in the future.
// Message can be a proto.Message or []byte. Other messages formats are not
// supported.
Message interface{}
}
@ -372,7 +372,7 @@ func (c *Cancel) toProto() *pb.GrpcLogEntry {
// omitted.
func metadataKeyOmit(key string) bool {
switch key {
case "lb-token", ":path", ":authority", "content-encoding", "user-agent", "te":
case "lb-token", ":path", ":authority", "content-encoding", "content-type", "user-agent", "te":
return true
case "grpc-trace-bin": // grpc-trace-bin is special because it's visiable to users.
return false

View File

@ -37,7 +37,7 @@ func TestLog(t *testing.T) {
ml := newMethodLogger(10, 10)
// Set sink to testing buffer.
buf := bytes.NewBuffer(nil)
ml.sink = NewWriterSink(buf)
ml.sink = newWriterSink(buf)
addr := "1.2.3.4"
port := 790
@ -337,7 +337,7 @@ func TestLog(t *testing.T) {
tc.want.SequenceIdWithinCall = uint64(i + 1)
ml.Log(tc.config)
inSink := new(pb.GrpcLogEntry)
if err := proto.Unmarshal(buf.Bytes(), inSink); err != nil {
if err := proto.Unmarshal(buf.Bytes()[4:], inSink); err != nil {
t.Errorf("failed to unmarshal bytes in sink to proto: %v", err)
continue
}

View File

@ -19,7 +19,13 @@
package binarylog
import (
"bufio"
"encoding/binary"
"fmt"
"io"
"io/ioutil"
"sync"
"time"
"github.com/golang/protobuf/proto"
pb "google.golang.org/grpc/binarylog/grpc_binarylog_v1"
@ -34,20 +40,34 @@ var (
//
// Not thread safe. Only set during initialization.
func SetDefaultSink(s Sink) {
if defaultSink != nil {
defaultSink.Close()
}
defaultSink = s
}
// Sink writes log entry into the binary log sink.
type Sink interface {
Write(*pb.GrpcLogEntry)
// Write will be called to write the log entry into the sink.
//
// It should be thread-safe so it can be called in parallel.
Write(*pb.GrpcLogEntry) error
// Close will be called when the Sink is replaced by a new Sink.
Close() error
}
type noopSink struct{}
func (ns *noopSink) Write(*pb.GrpcLogEntry) {}
func (ns *noopSink) Write(*pb.GrpcLogEntry) error { return nil }
func (ns *noopSink) Close() error { return nil }
// NewWriterSink creates a binary log sink with the given writer.
func NewWriterSink(w io.Writer) Sink {
// newWriterSink creates a binary log sink with the given writer.
//
// Write() marshalls the proto message and writes it to the given writer. Each
// message is prefixed with a 4 byte big endian unsigned integer as the length.
//
// No buffer is done, Close() doesn't try to close the writer.
func newWriterSink(w io.Writer) *writerSink {
return &writerSink{out: w}
}
@ -55,10 +75,88 @@ type writerSink struct {
out io.Writer
}
func (fs *writerSink) Write(e *pb.GrpcLogEntry) {
func (ws *writerSink) Write(e *pb.GrpcLogEntry) error {
b, err := proto.Marshal(e)
if err != nil {
grpclog.Infof("binary logging: failed to marshal proto message: %v", err)
}
fs.out.Write(b)
hdr := make([]byte, 4)
binary.BigEndian.PutUint32(hdr, uint32(len(b)))
if _, err := ws.out.Write(hdr); err != nil {
return err
}
if _, err := ws.out.Write(b); err != nil {
return err
}
return nil
}
func (ws *writerSink) Close() error { return nil }
type bufWriteCloserSink struct {
mu sync.Mutex
closer io.Closer
out *writerSink // out is built on buf.
buf *bufio.Writer // buf is kept for flush.
writeStartOnce sync.Once
writeTicker *time.Ticker
}
func (fs *bufWriteCloserSink) Write(e *pb.GrpcLogEntry) error {
// Start the write loop when Write is called.
fs.writeStartOnce.Do(fs.startFlushGoroutine)
fs.mu.Lock()
if err := fs.out.Write(e); err != nil {
fs.mu.Unlock()
return err
}
fs.mu.Unlock()
return nil
}
const (
bufFlushDuration = 60 * time.Second
)
func (fs *bufWriteCloserSink) startFlushGoroutine() {
fs.writeTicker = time.NewTicker(bufFlushDuration)
go func() {
for range fs.writeTicker.C {
fs.mu.Lock()
fs.buf.Flush()
fs.mu.Unlock()
}
}()
}
func (fs *bufWriteCloserSink) Close() error {
if fs.writeTicker != nil {
fs.writeTicker.Stop()
}
fs.mu.Lock()
fs.buf.Flush()
fs.closer.Close()
fs.out.Close()
fs.mu.Unlock()
return nil
}
func newBufWriteCloserSink(o io.WriteCloser) Sink {
bufW := bufio.NewWriter(o)
return &bufWriteCloserSink{
closer: o,
out: newWriterSink(bufW),
buf: bufW,
}
}
// NewTempFileSink creates a temp file and returns a Sink that writes to this
// file.
func NewTempFileSink() (Sink, error) {
tempFile, err := ioutil.TempFile("/tmp", "grpcgo_binarylog_*.txt")
if err != nil {
return nil, fmt.Errorf("failed to create temp file: %v", err)
}
return newBufWriteCloserSink(tempFile), nil
}

View File

@ -558,7 +558,7 @@ func (c *channelMap) GetServerSockets(id int64, startID int64) ([]*SocketMetric,
ids = append(ids, k)
}
sort.Sort(int64Slice(ids))
idx := sort.Search(len(ids), func(i int) bool { return ids[i] >= id })
idx := sort.Search(len(ids), func(i int) bool { return ids[i] >= startID })
count := 0
var end bool
for i, v := range ids[idx:] {
@ -601,8 +601,11 @@ func (c *channelMap) GetChannel(id int64) *ChannelMetric {
}
cm.NestedChans = copyMap(cn.nestedChans)
cm.SubChans = copyMap(cn.subChans)
// cn.c can be set to &dummyChannel{} when deleteSelfFromMap is called. Save a copy of cn.c when
// holding the lock to prevent potential data race.
chanCopy := cn.c
c.mu.RUnlock()
cm.ChannelData = cn.c.ChannelzMetric()
cm.ChannelData = chanCopy.ChannelzMetric()
cm.ID = cn.id
cm.RefName = cn.refName
cm.Trace = cn.trace.dumpData()
@ -620,8 +623,11 @@ func (c *channelMap) GetSubChannel(id int64) *SubChannelMetric {
return nil
}
cm.Sockets = copyMap(sc.sockets)
// sc.c can be set to &dummyChannel{} when deleteSelfFromMap is called. Save a copy of sc.c when
// holding the lock to prevent potential data race.
chanCopy := sc.c
c.mu.RUnlock()
cm.ChannelData = sc.c.ChannelzMetric()
cm.ChannelData = chanCopy.ChannelzMetric()
cm.ID = sc.id
cm.RefName = sc.refName
cm.Trace = sc.trace.dumpData()

View File

@ -1,4 +1,4 @@
// +build !appengine,go1.7
// +build !appengine
/*
*

View File

@ -1,4 +1,4 @@
// +build !linux appengine !go1.7
// +build !linux appengine
/*
*

View File

@ -1,4 +1,4 @@
// +build linux,go1.9,!appengine
// +build linux,!appengine
/*
*

View File

@ -1,4 +1,4 @@
// +build !linux !go1.9 appengine
// +build !linux appengine
/*
*

View File

@ -25,11 +25,45 @@ import (
)
const (
prefix = "GRPC_GO_"
retryStr = prefix + "RETRY"
prefix = "GRPC_GO_"
retryStr = prefix + "RETRY"
requireHandshakeStr = prefix + "REQUIRE_HANDSHAKE"
)
// RequireHandshakeSetting describes the settings for handshaking.
type RequireHandshakeSetting int
const (
// RequireHandshakeHybrid (default, deprecated) indicates to wait for
// handshake before considering a connection ready, but wait before
// considering successful.
RequireHandshakeHybrid RequireHandshakeSetting = iota
// RequireHandshakeOn (default after the 1.17 release) indicates to wait
// for handshake before considering a connection ready/successful.
RequireHandshakeOn
// RequireHandshakeOff indicates to not wait for handshake before
// considering a connection ready/successful.
RequireHandshakeOff
)
var (
// Retry is set if retry is explicitly enabled via "GRPC_GO_RETRY=on".
Retry = strings.EqualFold(os.Getenv(retryStr), "on")
// RequireHandshake is set based upon the GRPC_GO_REQUIRE_HANDSHAKE
// environment variable.
//
// Will be removed after the 1.18 release.
RequireHandshake RequireHandshakeSetting
)
func init() {
switch strings.ToLower(os.Getenv(requireHandshakeStr)) {
case "on":
RequireHandshake = RequireHandshakeOn
case "off":
RequireHandshake = RequireHandshakeOff
case "hybrid":
// Will be removed after the 1.17 release.
RequireHandshake = RequireHandshakeHybrid
}
}

View File

@ -20,12 +20,16 @@
// the sync package.
package grpcsync
import "sync"
import (
"sync"
"sync/atomic"
)
// Event represents a one-time event that may occur in the future.
type Event struct {
c chan struct{}
o sync.Once
fired int32
c chan struct{}
o sync.Once
}
// Fire causes e to complete. It is safe to call multiple times, and
@ -34,6 +38,7 @@ type Event struct {
func (e *Event) Fire() bool {
ret := false
e.o.Do(func() {
atomic.StoreInt32(&e.fired, 1)
close(e.c)
ret = true
})
@ -47,12 +52,7 @@ func (e *Event) Done() <-chan struct{} {
// HasFired returns true if Fire has been called.
func (e *Event) HasFired() bool {
select {
case <-e.c:
return true
default:
return false
}
return atomic.LoadInt32(&e.fired) == 1
}
// NewEvent returns a new, ready-to-use Event.

View File

@ -20,7 +20,7 @@
// symbols to avoid circular dependencies.
package internal
import "golang.org/x/net/context"
import "context"
var (
// WithContextDialer is exported by clientconn.go

View File

@ -1,4 +1,4 @@
// +build !appengine,go1.7
// +build !appengine
/*
*
@ -23,7 +23,10 @@
package syscall
import (
"fmt"
"net"
"syscall"
"time"
"golang.org/x/sys/unix"
"google.golang.org/grpc/grpclog"
@ -65,3 +68,47 @@ func CPUTimeDiff(first *Rusage, latest *Rusage) (float64, float64) {
return uTimeElapsed, sTimeElapsed
}
// SetTCPUserTimeout sets the TCP user timeout on a connection's socket
func SetTCPUserTimeout(conn net.Conn, timeout time.Duration) error {
tcpconn, ok := conn.(*net.TCPConn)
if !ok {
// not a TCP connection. exit early
return nil
}
rawConn, err := tcpconn.SyscallConn()
if err != nil {
return fmt.Errorf("error getting raw connection: %v", err)
}
err = rawConn.Control(func(fd uintptr) {
err = syscall.SetsockoptInt(int(fd), syscall.IPPROTO_TCP, unix.TCP_USER_TIMEOUT, int(timeout/time.Millisecond))
})
if err != nil {
return fmt.Errorf("error setting option on socket: %v", err)
}
return nil
}
// GetTCPUserTimeout gets the TCP user timeout on a connection's socket
func GetTCPUserTimeout(conn net.Conn) (opt int, err error) {
tcpconn, ok := conn.(*net.TCPConn)
if !ok {
err = fmt.Errorf("conn is not *net.TCPConn. got %T", conn)
return
}
rawConn, err := tcpconn.SyscallConn()
if err != nil {
err = fmt.Errorf("error getting raw connection: %v", err)
return
}
err = rawConn.Control(func(fd uintptr) {
opt, err = syscall.GetsockoptInt(int(fd), syscall.IPPROTO_TCP, unix.TCP_USER_TIMEOUT)
})
if err != nil {
err = fmt.Errorf("error getting option on socket: %v", err)
return
}
return
}

View File

@ -1,4 +1,4 @@
// +build !linux appengine !go1.7
// +build !linux appengine
/*
*
@ -20,7 +20,12 @@
package syscall
import "google.golang.org/grpc/grpclog"
import (
"net"
"time"
"google.golang.org/grpc/grpclog"
)
func init() {
grpclog.Info("CPU time info is unavailable on non-linux or appengine environment.")
@ -45,3 +50,14 @@ func GetRusage() (rusage *Rusage) {
func CPUTimeDiff(first *Rusage, latest *Rusage) (float64, float64) {
return 0, 0
}
// SetTCPUserTimeout is a no-op function under non-linux or appengine environments
func SetTCPUserTimeout(conn net.Conn, timeout time.Duration) error {
return nil
}
// GetTCPUserTimeout is a no-op function under non-linux or appengine environments
// a negative return value indicates the operation is not supported
func GetTCPUserTimeout(conn net.Conn) (int, error) {
return -1, nil
}

View File

@ -16,6 +16,7 @@
*
*/
// Package testutils contains testing helpers.
package testutils
import (

View File

@ -24,9 +24,10 @@ import (
)
const (
// bdpLimit is the maximum value the flow control windows
// will be increased to.
bdpLimit = (1 << 20) * 4
// bdpLimit is the maximum value the flow control windows will be increased
// to. TCP typically limits this to 4MB, but some systems go up to 16MB.
// Since this is only a limit, it is safe to make it optimistic.
bdpLimit = (1 << 20) * 16
// alpha is a constant factor used to keep a moving average
// of RTTs.
alpha = 0.9

Some files were not shown because too many files have changed in this diff Show More