2349 Commits

Author SHA1 Message Date
ca1b23bf3e Update CONTRIBUTING.md to CNCF CLA 2017-12-11 09:04:48 -08:00
2941ee12eb codes: Add UnmarshalJSON support to Code type (#1720) 2017-12-11 09:02:19 -08:00
ec61302c8e naming: Fix build constraints for go1.6 and go1.7 (#1718)
"go1.6, !go1.8" constraints are interpreted as (version >= 1.6 AND ) OR version < 1.8, where (version >= 1.6 AND ) is always false,
so it matches all go versions before 1.8, not only 1.6 and 1.7.

Removed a space, so the constraints are now matches only go1.6 and go1.7 versions
2017-12-07 12:43:58 -08:00
b8191e57b2 remove stringer and go generate (#1715) 2017-12-06 17:35:20 -08:00
ff1be3fcc5 Add WithResolverUserOptions for custom resolver build options (#1711) 2017-12-06 15:54:01 -08:00
580defabfe Fix grpc basics link in route_guide example (#1713) 2017-12-06 15:11:16 -08:00
b7dc71e7ea Optimize codes.String() method using a switch instead of a slice of indexes (#1712) 2017-12-06 10:50:43 -08:00
1fc873d0f6 Disable ccBalancerWrapper when it is closed (#1698) 2017-12-06 10:49:20 -08:00
bf35f1b961 Refactor roundrobin to support custom picker (#1707)
Split round_robin balancer into a base balancer (which manages SubConn and connectivity states), and a round_robin picker.
A custom picker with other picking algorithms can be provided to build custom balancers.
2017-12-05 11:27:28 -08:00
43083423e4 Change parseTimeout to not handle non-second durations (#1706) 2017-12-05 10:04:04 -08:00
be077907e2 make load balancing policy name string case-insensitive (#1708) 2017-12-04 14:03:22 -08:00
cd563b81ec protoCodec: avoid buffer allocations if proto.Marshaler/Unmarshaler (#1689)
* protoCodec: return early if proto.Marshaler

If the object to marshal implements proto.Marshaler, delegate to that
immediately instead of pre-allocating a buffer. (*proto.Buffer).Marshal
has the same logic, so the []byte buffer we pre-allocate in codec.go
would never be used.

This is mainly for users of gogoproto. If you turn on the "marshaler"
and "sizer" gogoproto options, the generated Marshal() method already
pre-allocates a buffer of the appropriate size for marshaling the
entire object.

* protoCodec: return early if proto.Unmarshaler

If the object to unmarshal implements proto.Unmarshaler, delegate to
that immediately. This perhaps saves a bit of work preparing the
cached the proto.Buffer object which would not end up being used for
the proto.Unmarshaler case.

Note that I moved the obj.Reset() call above the delegation to
obj.Unmarshal(). This maintains the grpc behavior of
proto.Unmarshalers always being Reset() before being delegated to,
which is consistent to how proto.Unmarshal() behaves (proto.Buffer
does not call Reset() in Unmarshal).
2017-12-01 15:32:05 -08:00
61c67402b9 Add comments to ClientConn/SubConn interfaces to indicate new methods may be added (#1680) 2017-12-01 13:25:57 -08:00
ddbb27e545 client: backoff before reconnecting if an HTTP2 server preface was not received (#1648) 2017-12-01 09:55:42 -08:00
a4bf341022 use the request context with net/http handler (#1696) 2017-11-30 14:37:49 -08:00
c6b46087ab transport: fix race sending RPC status that could lead to a panic (#1687)
WriteStatus can be called concurrently: one by SendMsg,
the other by RecvMsg. Then, closing writes channel
becomes racey without proper locking.

Make transport closing synchronous in such case.
2017-11-30 13:58:31 -08:00
00383af260 Fix misleading default resolver scheme comments (#1703)
Since a recent change, the default is `passthrough`, not `dns`.
2017-11-30 13:47:14 -08:00
a62701e4aa Eliminate data race in ccBalancerWrapper (#1688) 2017-11-28 14:41:43 -08:00
1e1a47f0f2 Re-resolve target when one connection becomes TransientFailure (#1679)
This allows ClientConn to get more up-to-date addresses from resolver.
ClientConn compares new addresses with the cached ones. So if resolver returns the same set of addresses, ClientConn will not notify balancer about it.

Also moved the initialization of resolver and balancer to avoid race. Balancer will only be started when ClientConn gets resolved addresses from balancer.
2017-11-28 13:16:53 -08:00
2ef021f78d New grpclb implementation (#1558)
The new grpclb supports fallback to backends if remote balancer is unavailable
2017-11-27 11:16:26 -08:00
10873b30bf Fix panics on balancer and resolver updates (#1684)
- NewAddress with empty list (addrConn with an empty address list)
 - NewServiceConfig to switch balancer before the first balancer is built
2017-11-22 13:59:20 -08:00
646f701c82 Change version to 1.9.0-dev (#1682) 2017-11-22 10:46:06 -08:00
6253aa9397 set context timeout when Timeout value >= 0 (#1678)
To be consistent with call.go/invoke

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-11-20 13:49:49 -08:00
d6cc72862b switch balancer based on service config info (#1670) 2017-11-17 11:11:05 -08:00
816fa5b06f Add proper support for 'identity' encoding type (#1664) 2017-11-17 09:24:54 -08:00
c1fc29613d update code_string.go for new stringer changes (#1674)
To fix travis check failures
2017-11-14 15:20:10 -08:00
409fd8e23b addrConn: set ac.state to TransientFailure upon non-temporary errors (#1657)
So failfast RPCs will fail with unavailable errors when this happens.
2017-11-13 16:33:42 -08:00
87bcb38fba Eliminate race on ac.acbw (#1666)
Guard ac.acbw with mutex
2017-11-13 13:43:31 -08:00
5f2e2f999e Corrected documentation on Server.Serve (#1668) 2017-11-13 13:37:12 -08:00
de2209a968 Update picker doc when returned SubConn is not ready (#1659) 2017-11-09 13:53:22 -08:00
ebefec97dd travis: fix GOARCH=386 and add misspell check (#1658)
- Define env variable RUN386 and set GOARCH later, instead of assigning to GOARCH directly. Otherwise, gimme will override GOARCH back
- Add misspell check
- Disable -race on 386
2017-11-08 13:40:05 -08:00
abd3e10d78 Add context benchmarks (#1610) 2017-11-07 10:20:24 -08:00
3790967af4 Add protoc command to example/readme (#1653)
So users can copy the command and try with their own protos.
2017-11-06 14:58:18 -08:00
8ff8683602 Implement transparent retries for gRFC A6 (#1597) 2017-11-06 13:45:11 -08:00
551f295763 server: add EXPERIMENTAL tag to grpc.ConnectTimeout (#1652) 2017-11-06 10:29:48 -08:00
865013bc17 *: replace deprecated grpc.Errorf calls with status.Errorf (#1651) 2017-11-06 10:24:20 -08:00
4318e6475c server: apply deadline to new connections until all handshaking is completed (#1646) 2017-11-03 13:53:17 -07:00
60f1f6aa07 codec_benchmark_test: fix racy unmarshal behavior and make some cleanups (#1642) 2017-11-02 13:42:21 -07:00
ac0ac2b80e Speed-up quota pools. (#1636)
* First commit.

* First commit.

* Second commit.

* Post-review update.
2017-11-02 13:39:27 -07:00
af224a8a48 Check ac state shutdown before setting it to TransientFailure (#1643) 2017-11-02 09:56:04 -07:00
08a4535419 vet.sh: don't check git status when doing -install (#1641) 2017-11-01 13:14:29 -07:00
fc6acc5e5e latency: Listen on localhost:0 instead of :0 in test (#1640) 2017-11-01 10:52:07 -07:00
fb4b2b29e4 reduce timeout for tests to 5m (7m for testrace) (#1635) 2017-10-31 14:07:09 -07:00
5db344a40a Introduce new Compressor/Decompressor API (#1428) 2017-10-31 10:21:13 -07:00
246b2f7081 Fix settings ack race (#1630)
* First commit.

* fixed a bug

* mend

* remove debug residual

* Apply settings in the reader goroutine instead of writer.

* Post-review updates

* Post-review update.
2017-10-31 10:19:55 -07:00
c91118c8fa Update examples/README.md (#1629) 2017-10-30 10:54:07 -07:00
a4ff4e29c4 Get method string from stream (#1588) 2017-10-26 16:03:44 -07:00
fe0602d9d8 fix max msg size type issues on different arch (#1623) 2017-10-26 13:30:15 -07:00
3cc21586ac Deflake roundrobin TestOneServerDown, and fix test error messages (#1622) 2017-10-26 13:29:55 -07:00
0d399e6307 Remove self-imposed limit on max concurrent streams if the server doesn't impose any. (#1624)
* Remove self-imposed limit on max concurrent streams if the server allows it.

* Remove test necessitating buggy behavior.
2017-10-26 10:05:17 -07:00