This commit is contained in:
Karsten Weiss
2018-04-16 19:03:02 +02:00
committed by Menghan Li
parent ef3a1ad826
commit 7de9139327
15 changed files with 26 additions and 26 deletions

View File

@ -38,7 +38,7 @@ To run the example, first start the server:
$ go run examples/rpc_errors/server/main.go $ go run examples/rpc_errors/server/main.go
``` ```
In a separate sesssion, run the client: In a separate session, run the client:
``` ```
$ go run examples/rpc_errors/client/main.go $ go run examples/rpc_errors/client/main.go

View File

@ -165,7 +165,7 @@ var (
) )
// Picker is used by gRPC to pick a SubConn to send an RPC. // Picker is used by gRPC to pick a SubConn to send an RPC.
// Balancer is expected to generate a new picker from its snapshot everytime its // Balancer is expected to generate a new picker from its snapshot every time its
// internal state has changed. // internal state has changed.
// //
// The pickers used by gRPC can be updated by ClientConn.UpdateBalancerState(). // The pickers used by gRPC can be updated by ClientConn.UpdateBalancerState().

View File

@ -115,7 +115,7 @@ func newCCBalancerWrapper(cc *ClientConn, b balancer.Builder, bopts balancer.Bui
return ccb return ccb
} }
// watcher balancer functions sequencially, so the balancer can be implemeneted // watcher balancer functions sequentially, so the balancer can be implemented
// lock-free. // lock-free.
func (ccb *ccBalancerWrapper) watcher() { func (ccb *ccBalancerWrapper) watcher() {
for { for {

View File

@ -44,7 +44,7 @@ type testWatcher struct {
update chan *naming.Update update chan *naming.Update
// the side channel to get to know how many updates in a batch // the side channel to get to know how many updates in a batch
side chan int side chan int
// the channel to notifiy update injector that the update reading is done // the channel to notify update injector that the update reading is done
readDone chan int readDone chan int
} }

View File

@ -187,7 +187,7 @@ func (s *workerServer) CoreCount(ctx context.Context, in *testpb.CoreRequest) (*
} }
func (s *workerServer) QuitWorker(ctx context.Context, in *testpb.Void) (*testpb.Void, error) { func (s *workerServer) QuitWorker(ctx context.Context, in *testpb.Void) (*testpb.Void, error) {
grpclog.Printf("quiting worker") grpclog.Printf("quitting worker")
s.stop <- true s.stop <- true
return &testpb.Void{}, nil return &testpb.Void{}, nil
} }

View File

@ -1096,7 +1096,7 @@ func (ac *addrConn) errorf(format string, a ...interface{}) {
// resetTransport recreates a transport to the address for ac. The old // resetTransport recreates a transport to the address for ac. The old
// transport will close itself on error or when the clientconn is closed. // transport will close itself on error or when the clientconn is closed.
// The created transport must receive initial settings frame from the server. // The created transport must receive initial settings frame from the server.
// In case that doesnt happen, transportMonitor will kill the newly created // In case that doesn't happen, transportMonitor will kill the newly created
// transport after connectDeadline has expired. // transport after connectDeadline has expired.
// In case there was an error on the transport before the settings frame was // In case there was an error on the transport before the settings frame was
// received, resetTransport resumes connecting to backends after the one that // received, resetTransport resumes connecting to backends after the one that
@ -1141,7 +1141,7 @@ func (ac *addrConn) resetTransport() error {
connectDeadline = start.Add(dialDuration) connectDeadline = start.Add(dialDuration)
ridx = 0 // Start connecting from the beginning. ridx = 0 // Start connecting from the beginning.
} else { } else {
// Continue trying to conect with the same deadlines. // Continue trying to connect with the same deadlines.
connectRetryNum = ac.connectRetryNum connectRetryNum = ac.connectRetryNum
backoffDeadline = ac.backoffDeadline backoffDeadline = ac.backoffDeadline
connectDeadline = ac.connectDeadline connectDeadline = ac.connectDeadline

View File

@ -153,10 +153,10 @@ type ipWatcher struct {
updateChan chan *Update updateChan chan *Update
} }
// Next returns the adrress resolution Update for the target. For IP address, // Next returns the address resolution Update for the target. For IP address,
// the resolution is itself, thus polling name server is unncessary. Therefore, // the resolution is itself, thus polling name server is unnecessary. Therefore,
// Next() will return an Update the first time it is called, and will be blocked // Next() will return an Update the first time it is called, and will be blocked
// for all following calls as no Update exisits until watcher is closed. // for all following calls as no Update exists until watcher is closed.
func (i *ipWatcher) Next() ([]*Update, error) { func (i *ipWatcher) Next() ([]*Update, error) {
u, ok := <-i.updateChan u, ok := <-i.updateChan
if !ok { if !ok {

View File

@ -30,7 +30,7 @@ type Operation uint8
const ( const (
// Add indicates a new address is added. // Add indicates a new address is added.
Add Operation = iota Add Operation = iota
// Delete indicates an exisiting address is deleted. // Delete indicates an existing address is deleted.
Delete Delete
) )

View File

@ -72,21 +72,21 @@ message ExtensionRequest {
message ServerReflectionResponse { message ServerReflectionResponse {
string valid_host = 1; string valid_host = 1;
ServerReflectionRequest original_request = 2; ServerReflectionRequest original_request = 2;
// The server set one of the following fields according to the message_request // The server sets one of the following fields according to the
// in the request. // message_request in the request.
oneof message_response { oneof message_response {
// This message is used to answer file_by_filename, file_containing_symbol, // This message is used to answer file_by_filename, file_containing_symbol,
// file_containing_extension requests with transitive dependencies. As // file_containing_extension requests with transitive dependencies.
// the repeated label is not allowed in oneof fields, we use a // As the repeated label is not allowed in oneof fields, we use a
// FileDescriptorResponse message to encapsulate the repeated fields. // FileDescriptorResponse message to encapsulate the repeated fields.
// The reflection service is allowed to avoid sending FileDescriptorProtos // The reflection service is allowed to avoid sending FileDescriptorProtos
// that were previously sent in response to earlier requests in the stream. // that were previously sent in response to earlier requests in the stream.
FileDescriptorResponse file_descriptor_response = 4; FileDescriptorResponse file_descriptor_response = 4;
// This message is used to answer all_extension_numbers_of_type requst. // This message is used to answer all_extension_numbers_of_type requests.
ExtensionNumberResponse all_extension_numbers_response = 5; ExtensionNumberResponse all_extension_numbers_response = 5;
// This message is used to answer list_services request. // This message is used to answer list_services requests.
ListServiceResponse list_services_response = 6; ListServiceResponse list_services_response = 6;
// This message is used when an error occurs. // This message is used when an error occurs.

View File

@ -95,7 +95,7 @@ func (ccr *ccResolverWrapper) start() {
go ccr.watcher() go ccr.watcher()
} }
// watcher processes address updates and service config updates sequencially. // watcher processes address updates and service config updates sequentially.
// Otherwise, we need to resolve possible races between address and service // Otherwise, we need to resolve possible races between address and service
// config (e.g. they specify different balancer types). // config (e.g. they specify different balancer types).
func (ccr *ccResolverWrapper) watcher() { func (ccr *ccResolverWrapper) watcher() {

View File

@ -362,7 +362,7 @@ func (o CompressorCallOption) after(c *callInfo) {}
// //
// If CallCustomCodec is not also used, the content-subtype will be used to // If CallCustomCodec is not also used, the content-subtype will be used to
// look up the Codec to use in the registry controlled by RegisterCodec. See // look up the Codec to use in the registry controlled by RegisterCodec. See
// the documention on RegisterCodec for details on registration. The lookup // the documentation on RegisterCodec for details on registration. The lookup
// of content-subtype is case-insensitive. If no such Codec is found, the call // of content-subtype is case-insensitive. If no such Codec is found, the call
// will result in an error with code codes.Internal. // will result in an error with code codes.Internal.
// //

View File

@ -175,7 +175,7 @@ func (s *outStream) deleteSelf() {
} }
type outStreamList struct { type outStreamList struct {
// Following are sentinal objects that mark the // Following are sentinel objects that mark the
// beginning and end of the list. They do not // beginning and end of the list. They do not
// contain any item lists. All valid objects are // contain any item lists. All valid objects are
// inserted in between them. // inserted in between them.

View File

@ -860,7 +860,7 @@ func (t *http2Server) keepalive() {
// The connection has been idle for a duration of keepalive.MaxConnectionIdle or more. // The connection has been idle for a duration of keepalive.MaxConnectionIdle or more.
// Gracefully close the connection. // Gracefully close the connection.
t.drain(http2.ErrCodeNo, []byte{}) t.drain(http2.ErrCodeNo, []byte{})
// Reseting the timer so that the clean-up doesn't deadlock. // Resetting the timer so that the clean-up doesn't deadlock.
maxIdle.Reset(infinity) maxIdle.Reset(infinity)
return return
} }
@ -872,7 +872,7 @@ func (t *http2Server) keepalive() {
case <-maxAge.C: case <-maxAge.C:
// Close the connection after grace period. // Close the connection after grace period.
t.Close() t.Close()
// Reseting the timer so that the clean-up doesn't deadlock. // Resetting the timer so that the clean-up doesn't deadlock.
maxAge.Reset(infinity) maxAge.Reset(infinity)
case <-t.ctx.Done(): case <-t.ctx.Done():
} }
@ -885,7 +885,7 @@ func (t *http2Server) keepalive() {
} }
if pingSent { if pingSent {
t.Close() t.Close()
// Reseting the timer so that the clean-up doesn't deadlock. // Resetting the timer so that the clean-up doesn't deadlock.
keepalive.Reset(infinity) keepalive.Reset(infinity)
return return
} }

View File

@ -261,9 +261,9 @@ func (d *decodeState) decodeResponseHeader(frame *http2.MetaHeadersFrame) error
// gRPC status doesn't exist and http status is OK. // gRPC status doesn't exist and http status is OK.
// Set rawStatusCode to be unknown and return nil error. // Set rawStatusCode to be unknown and return nil error.
// So that, if the stream has ended this Unknown status // So that, if the stream has ended this Unknown status
// will be propogated to the user. // will be propagated to the user.
// Otherwise, it will be ignored. In which case, status from // Otherwise, it will be ignored. In which case, status from
// a later trailer, that has StreamEnded flag set, is propogated. // a later trailer, that has StreamEnded flag set, is propagated.
code := int(codes.Unknown) code := int(codes.Unknown)
d.rawStatusCode = &code d.rawStatusCode = &code
return nil return nil

View File

@ -1908,7 +1908,7 @@ func (s *httpServer) start(t *testing.T, lis net.Listener) {
} }
// Read preface sent by client. // Read preface sent by client.
if _, err = io.ReadFull(s.conn, make([]byte, len(http2.ClientPreface))); err != nil { if _, err = io.ReadFull(s.conn, make([]byte, len(http2.ClientPreface))); err != nil {
t.Errorf("Error at server-side while reading preface from cleint. Err: %v", err) t.Errorf("Error at server-side while reading preface from client. Err: %v", err)
return return
} }
reader := bufio.NewReaderSize(s.conn, defaultWriteBufSize) reader := bufio.NewReaderSize(s.conn, defaultWriteBufSize)