Commit Graph

2048 Commits

Author SHA1 Message Date
Yuxuan Li ecbc34aaca move server defaults, delete defer cancel() in stream.go 2017-04-26 17:39:57 -07:00
Yuxuan Li eaa9ccb053 minor comment change 2017-04-26 16:23:24 -07:00
Yuxuan Li 9c5f260e67 make max size a pointer type and initialize function a CallOption 2017-04-26 15:50:58 -07:00
Yuxuan Li 983d8372ea update the merge of client api and sc 2017-04-21 16:18:59 -07:00
Yuxuan Li bab6b617b7 merge master 2017-04-21 16:07:34 -07:00
Menghan Li ef10a566fe Revert "To adhere with protocol the server should send RST_STREAM on observing timeout on a strea, (#1130)"
This reverts commit 6d0e6b04b3.
2017-04-21 15:55:12 -07:00
MakMukhi 2d949be2fe Make sure all in-flight streams close when ClientConn.Close() is called. (#1136)
* Make sure all in-flight streams close when ClientConn.Close() is called.

* added test
2017-04-21 15:03:04 -07:00
MakMukhi 6d0e6b04b3 To adhere with protocol the server should send RST_STREAM on observing timeout on a strea, (#1130) 2017-04-21 15:02:51 -07:00
Santiago Castro 6914ab1e33 Fix broken Markdown headings in examples/gotutorial.md (#1189) 2017-04-18 10:54:52 -07:00
Menghan Li 955c867061 Support proxy with dialer (#1098)
With this change, the default dialer checks environment variables to see if proxy is needed. If so, it dials to the proxy and does an HTTP CONNECT handshake.
2017-04-17 16:08:50 -07:00
Yuxuan Li cb02ab4d25 change error message from InvalidArgument to ResourceExhausted 2017-04-13 16:51:56 -07:00
Yuxuan Li 8788b75675 merge master resolve conflicts 2017-04-13 16:28:15 -07:00
Menghan Li 8a6eb0f6e9 grpclb should connect to the second balancer (#1181)
grpclb needs to connect the second resolved balancer address when the first balancer disconnects.
If grpclb gets 2 resolved addresses: balancer1 and balancer2. When balancer1 disconnects, grpclb should automatically start to use balancer2.
2017-04-13 13:41:35 -07:00
apolcyn 0e8b58d22f use proto.Buffer API for protobuf codec and cache proto.Buffer structs (#1010)
* use a global sharded pool of proto.Buffer caches in protoCodec

* fix goimports

* make global buffer pool index counter atomic

* hack to remove alloc in encode_len_struct

* remove extra slice alloc in proto codec marshal

* replce magic number for proto size field length with constant

* replace custom cache with sync.Pool

* remove 1 line functions in codec.go and add protoCodec microbenchmarks

* add concurrent usage test for protoCodec

* fix golint.gofmt,goimport checks

* fix issues in codec.go and codec_test.go

* use go parallel benchmark helpers

* replace proto.Codec with a guess of size needed

* update Fatalf -> Errorf in tests

* wrap proto.Buffer along with cached last size into larger struct for pool use

* make wrapped proto buffer only a literal

* fix style and imports

* move b.Run into inner function

* reverse micro benchmark op order to unmarshal-marshal and fix benchmark setup-in-test bug

* add test for large message

* remove use of defer in codec.marshal

* revert recent changes to codec bencmarks

* move sub-benchmarks into >= go-1.7 only file

* add commentfor marshaler and tweak benchmark subtests for easier usage

* move build tag for go1.7 on benchmarks to inside file

* move build tag to top of file

* comment Codec, embed proto.Buffer into cached struct and add an int32 cap
2017-04-12 20:35:59 -07:00
Menghan Li cd8432ec07 Move handling stats.End to clientStream.finish() (#1182)
* move handling stats.End to clientStream.finish()
* add stats test for streaming RPC not calling last recv()
2017-04-12 11:55:54 -07:00
Grayson Koonce 6d158dbf32 Fix markdown in README.md (#1180)
Title was not being formatted correctly.
2017-04-11 23:39:30 -07:00
apolcyn ff17eeb5f6 opt in to frame reuse on the framer to reduce garbage (#1096) 2017-04-10 15:44:10 -07:00
MakMukhi bfa5dd27dc Client should update keepalive parameters upon receiving GoAway with … (#1169)
* Client should update keepalive parameters upon receiving GoAway with EnhanceYourCalm and debug data of too_many_pings.
2017-04-10 14:33:51 -07:00
dfawley b47cbd158b Use proto import from google.golang.org instead of github.com (#1176) 2017-04-10 10:15:59 -07:00
lyuxuan 9090ef91c3 Merge pull request #1173 from lyuxuan/fix_status_return
add error handling for InvalidArgument error from sendResponse()
2017-04-07 16:26:28 -07:00
dfawley 0c1d39df28 Separate incoming and outgoing metadata in context
This will prevent the incoming RPCs' metadata from appearing in outgoing RPCs
unless it is explicitly copied, e.g.:

incomingMD, ok := metadata.FromContext(ctx)
if ok {
  ctx = metadata.NewContext(ctx, incomingMD)
}

Fixes #1148
2017-04-07 11:54:56 -07:00
Anthony Romano 087f3d6e02 transport: implement GoString on Stream (#1167)
So context.String() won't  race when printing %#v.

It is not thread-safe to call context.String() on any context with a
stream value since valueCtx will use %#v to access all of the Stream
fields without holding a lock. Instead, print the Stream's pointer and
method for its GoString.
2017-04-07 11:16:52 -07:00
Yuxuan Li 74a632af0e fix comments 2017-04-06 17:28:41 -07:00
Yuxuan Li aad28b3c55 add error handling for InvalidArgument error from sendResponse() 2017-04-06 14:40:53 -07:00
Yuxuan Li c6a3937033 fix send response error case 2017-04-06 14:30:59 -07:00
Yuxuan Li fa2968617c Merge branch 'master' into service_config_pr 2017-04-06 14:12:34 -07:00
Yuxuan Li 6f8b55318a fix the testMaxMsgSizeServerAPI failure 2017-04-06 14:08:04 -07:00
marcushines 9f9c190692 Fix typo in interceptor.go (#1172) 2017-04-06 13:50:23 -07:00
dfawley 1d27587e10 Change status package to deal with concrete types instead of interfaces (#1171) 2017-04-06 11:41:07 -07:00
Yuxuan Li f1bb70facf gofmt 2017-04-05 15:08:25 -07:00
lyuxuan f02290b023 Merge branch 'master' into service_config_pr 2017-04-05 11:15:55 -07:00
Yuxuan Li a66f9231a8 Make initial service config non-blocking in Dial() 2017-04-05 11:08:50 -07:00
dfawley b507112439 Add status package for reporting gRPC status and errors (#1156)
When an error implemented by the status package is returned from a service
handler, the server will transmit a rich status message in the
"grpc-status-details-bin" trailing metadata field if any detailed data is
attached to the error.  Client-side, we will decode them if present in the
server's response and return them to the user code performing the RPC.

This is backward compatible with the existing errors supported by the grpc
package.  However, the grpc.Errorf, grpc.Code and grpc.ErrorDesc functions for
managing errors are now deprecated; status.Errorf and status.Status type
asserions should be used instead.
2017-04-05 10:35:40 -07:00
MakMukhi f45e6e3b30 Bug fix(Issue#1141): Check if peer is nil before trying to derefer it. (#1143) 2017-04-04 15:08:14 -07:00
Yuxuan Li ad16b942fb fix gofmt goimports go tool vet errors 2017-04-03 16:03:05 -07:00
apolcyn ee8ed34bcf get more metrics from go benchmark servers (#913)
* add user and system cpu usage to go benchmarks

* fix import and style issues

* sample elapsed time diffs after merging histograms

* style fixes and variables renames

* add pprof server to benchmark workers to grab different profile stats

* rename variables for consistency and default to no pprof
2017-04-03 15:53:03 -07:00
Yuxuan Li a0b902a11d fix missing import 2017-04-03 15:29:39 -07:00
Yuxuan Li 13b5f120b0 merge master 2017-04-03 15:20:13 -07:00
Yuxuan Li 50d4175072 Add client and service side apis for limiting the send/recv msg size. Update MethodConfig struct 2017-04-03 15:03:24 -07:00
Menghan Li b982c1caa6 Behavior change: do not strip out gRPC user-agent (#1158) 2017-04-03 12:31:31 -07:00
MakMukhi b2fae0cf40 Implementation for server enforcement of keepalive policy. (#1147)
Implementation of server enforcement of keepalive policy.
Server will close connection with a client that violates this policy.
Policy parameters:
 - MinTime is the minimum amount of time a client should wait before sending a keepalive ping.
 - If PermitWithoutStream true, server expects keepalive pings even when there are no active streams(RPCs).
2017-03-31 11:37:51 -07:00
Menghan Li 7fc29d0caa populate initReq target name and fix IP []byte type in grpclb (#1145) 2017-03-28 12:10:54 -07:00
Menghan Li b3cc2b5eca pick a random address if the current in use is deleted by resolver (#1135) 2017-03-28 11:13:46 -07:00
Menghan Li ccdf270424 add document to ClientHandshake about returning temporary error (#1125) 2017-03-28 11:12:50 -07:00
Menghan Li 0df08a7a03 :authority should include port number (#1123) 2017-03-28 11:09:23 -07:00
Menghan Li 14a6be430b Add grpc.Version string and use it in the UA (#1144) 2017-03-24 11:29:02 -07:00
Menghan Li 0a20758157 remove support for go1.5 (#1132) 2017-03-23 20:52:49 -07:00
MakMukhi c3df40279c Support max age(#1119)
The new logic added to the server does the following:
- Gracefully closes an idle connection after a duration of keepalive.MaxConnectionIdle.
- Gracefully closes any connection after a duration of keepalive.MaxConnectionAge.
- Forcibly closes a connection after an additive period of keepalive.MaxConnectionAgeGrace over keepalive.MaxConnectionAge.
- Makes sure a connection is alive by sending pings with a frequency of keepalive.Time and closes a non-resposive connection after an additional duration of keepalive.Timeout.
2017-03-23 10:49:38 -07:00
Mahak Mukhi d9541d7591 post-review commit. 2017-03-22 15:24:17 -07:00
MakMukhi 9d8d0c6e0a Update test to work according to changes made to maxStreams behavior. (#1137) 2017-03-22 13:52:10 -07:00