2568 Commits

Author SHA1 Message Date
536e74e045 Don't log grpclb server ending connection as error (#2162)
Fixes https://github.com/grpc/grpc-go/issues/2161

I introduced `serverTerminatedConnectionErr `, because I wanted `callRemoteBalancer` to still returns error on a terminated connections. Its client, which is function `watchRemoteBalancer` can decide how to log this error.

When remote grpclb-server terminates the connection, don't log it as
error. Instead, log it as info.

It is natural for servers to terminate long lived grpc streaming
connections. Two sample reasons to do this are: load balancing and
deployment of a new version. Therefore client of grpclb-server shouldn't
recognise this situation as an error.
2018-06-19 14:54:40 -07:00
b28608a9db channelz: move APIs to internal except channelz service (#2157) 2018-06-18 17:59:08 -07:00
3b3ed4f509 transport: notify controlbuf that transport is gracefully closing to ensure proper cleanup (#2158) 2018-06-18 15:39:16 -07:00
fd9db51e64 Register incoming stream with loopy as soon as it gets created. (#2144) 2018-06-18 10:52:49 -07:00
7e6dc36bea Import grpclb package in the interop client (#2155)
This can allow the interop client to start running in scenarios in which the target is grpclb balanced.
2018-06-15 15:00:04 -07:00
d2f8e5a29d fix: do not percent encode character tilde (#2139) 2018-06-14 16:03:11 -07:00
692f13ae39 grpclb: backoff for RPC call if init handshake was unsucessful (#2077) 2018-06-14 14:31:41 -07:00
e218c924aa status: handle invalid utf-8 characters (#2109) (#2134)
fixes #2078

A status with invalid utf-8 characters could still be created, but invalid characters will be replaced with [Unicode replacement character](https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character) before being sent out. Those bytes will still be percent encoded.

All details added to this invalid status will be dropped.
2018-06-14 13:53:31 -07:00
e074afe740 Don't do extra work for keepalive when it's disabled. (#2148) 2018-06-14 13:36:28 -07:00
24f3cca1ff internal: move backoff to internal (#2141)
So other components such as grpclb can reuse the backoff implementation.
2018-06-13 16:07:37 -07:00
107f19369e Fix flaky tests in transport. (#2120)
* Fix flaky tests in transport.

* Post-review update
2018-06-12 17:52:44 -07:00
fb845db15c internal: Change Lock to RLock since no mutation is performed (#2142) 2018-06-12 12:50:43 -07:00
aa30531d2b grpclb: remove redundent testing struct (#2126)
Remove `rpcStatsForTest` and reuse `rpcStats` in tests.

Also fix races: https://travis-ci.org/grpc/grpc-go/jobs/388477002
2018-06-12 11:29:05 -07:00
dc86fffc26 Normalize gRPC LB 2018-06-11 17:52:20 -07:00
6d55ae1afe Fix test: Account for the fact that Dial can return successfully before Accept. (#2123) 2018-06-11 14:33:42 -07:00
10a4999db0 Add some debug info (#2136) 2018-06-11 10:38:41 -07:00
49c8c81756 Documentation: create doc describing grpc-go's log levels and their usages (#2033) 2018-06-11 09:31:41 -07:00
39a411827d internal: Update proto generated code (#2133) 2018-06-08 17:54:26 -07:00
6f35246b2a resolver_conn_wrapper.go: fix minor typo (#2135) 2018-06-08 15:37:41 -07:00
0e5a36b652 internal: move leakcheck to internal/ (#2129)
internal: move leakcheck to internal/
2018-06-07 16:57:56 -07:00
26ac8d285c Revert "status: handle invalid utf-8 characters" (#2127)
Reverts grpc/grpc-go#2109

Test failure:
https://travis-ci.org/grpc/grpc-go/builds/388898555

Possible reason: `proto.Marshal` doesn't always return error even if message contains invalid utf8 char.
2018-06-06 17:58:36 -07:00
9c658603f0 status: handle invalid utf-8 characters (#2109)
fixes #2078

A status with invalid utf-8 characters could still be created, but invalid characters will be replaced with [Unicode replacement character](https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character) before being sent out. Those bytes will still be percent encoded.

All details added to this invalid status will be dropped.
2018-06-06 10:58:32 -07:00
96cefb43cf Revert " channelz: stage 4 - add security and socket option info" (#2124)
Reverts grpc/grpc-go#2098

Appengine will fail with the error below:
```
go-app-builder: Failed parsing input: parser: bad import "syscall" in google.golang.org/grpc/channelz/funcs.go from GOPATH
```

The root cause of it is in type_linux.go.
629f6bc5e5/channelz/types_linux.go (L21-L25)
2018-06-05 18:04:12 -07:00
629f6bc5e5 grpclb: minor fixes on comments and tests (#2122)
* modify noimport.go panic message
* package level comments
* remove useless error check at grpclb_test.go:343
2018-06-05 13:52:07 -07:00
c1a21e22a6 channelz: stage 4 - add security and socket option info (#2098) 2018-06-05 13:50:19 -07:00
4344c204c9 Split grpclb out of top level grpc package (#2107)
This PR splits out grpclb from grpc.  I have made the PR in several commits so you can see more clearly the steps that happened.

There are a few possibly contentious points that I would like to make clear up front:

* grpclb will no longer autoload as a load balancer.  I think this is okay, as service config is not widely (at all?) used, and I believe this is the only way to access it.
* `internal` is used more, as a way of having code shared between packages without exposing types
* ConnectivityStateEvaluator, as used by grpclb, is no longer thread safe.  I believe there is an outer mutex that guards access, but I want to point out this subtle change up here.

All but one tests pass with this, due to another cyclic dependency.  I can fix this, but it is a little more widely scoped (such as exposing grpc.server and grpc.errorDesc in the internal package).   This PR is a nearly-passing sample of that last step to get this working. 

PTAL @menghanl @dfawley
2018-06-05 09:54:12 -07:00
35085cc92d Reduce error logs in transport. (#2117) 2018-06-04 15:25:35 -07:00
2c5843ebfd DNS resolver: Throw an error for non-default DNS authority. (#2067) 2018-06-04 10:43:01 -07:00
70e9c28461 grpclb: sync messages.proto and update client load reporting (#2101) 2018-06-04 10:02:09 -07:00
130c87fa0d alts: copy handshake address in Clone() (#2119) 2018-06-01 15:33:31 -07:00
b94ea975f3 codes: fix: marshal/unmarshal a Code to JSON fails (#2116)
Marshalling a Code to JSON and unmarshalling it failed with an
"invalid code" error message.

Code is of type uint32. It has no custom MarshalJson() implemented
therefore it is marshalled into an JSON integer value.
The UnmarshalJSON() function expected that the marshalled Code is a
String type, unmarshalling failed.

Check in UnmarshalJSON() if the value is an uint32 in the range of the
defined Code values. If it is, unmarshal it.

This commit also adds an Marshal/Unmarshal testcase.
2018-06-01 10:56:55 -07:00
590da37e2d Account for user configured small io write buffer. (#2092) 2018-05-29 14:11:52 -07:00
bfe419798a clarify CloseSend vs CloseAndRecv; better formatting (#2071)
clarify CloseSend vs CloseAndRecv; better formatting
2018-05-29 11:35:11 -07:00
bd7f82c7b1 internal/grpcrand: New package for concurrency-safe randoms (#2106) 2018-05-29 09:06:35 -07:00
1fa3750c9a Clarify newCCResolverWrapper documentation. (#2100)
I think the goroutine does not get started any more (this used to be the case in an earlier version).
2018-05-24 10:21:01 -07:00
d33a923190 Revert "channelz: stage 4 - add security and socket option info" (#2096)
This reverts commit 7cc2837209c4fa87008717b4e94a085820d7d779.

The PR breaks darwin builds

src/google.golang.org/grpc/channelz/types_unix.go:35:15: undefined: unix.TCPInfo
2018-05-22 15:31:57 -07:00
7cc2837209 channelz: stage 4 - add security and socket option info (#1965) 2018-05-22 13:32:02 -07:00
c16e07b130 stickiness: limit the max count of stickiness keys (#2021)
And remove the oldest when the limit was already reached.
2018-05-21 17:10:29 -07:00
dea4e57312 Benchmarks that runs server and client and separate processes. (#1952) 2018-05-21 16:00:01 -07:00
8f06f82ca3 Synchronize WriteStatus with WriteHeader on server. (#2074) 2018-05-21 15:59:39 -07:00
f669235193 internal: update proto generated code (#2093) 2018-05-21 09:59:26 -07:00
3b7feb1847 health: generate health proto from grpc-proto (#2081) 2018-05-17 11:11:47 -07:00
be1fb4f275 internal: remove redundant channelz service go generate (#2085) 2018-05-16 18:03:05 -07:00
1bacc35978 Revert "Strip port from server name in grpclb (#2066)" (#2083)
This reverts commit d24d0a4b993587a34ac7d09ac956b0375ee7d1fa.
2018-05-16 15:37:34 -07:00
4e829f028a channelz: generate proto from grpc-proto repo (#2082) 2018-05-16 13:51:51 -07:00
b4dd78522b internal: move version to a separate file (#2080)
So it's easier to update version when doing releases.
2018-05-16 10:32:41 -07:00
679ceaae57 internal: fix travis failure on alts proto (#2079) 2018-05-16 10:32:11 -07:00
dbffeabcbc test: make end2end test use split grpc / proto imports (#2069) 2018-05-16 10:03:45 -07:00
9020130bcf credentials/alts: make go:generate rebuild alts protos (#2056) 2018-05-15 15:42:21 -07:00
f64553fe64 channelz: split channelz grpc and pb (#2068) 2018-05-15 11:24:46 -07:00