2689 Commits

Author SHA1 Message Date
491af2b0a4 grpclb: downgrade error logs to warning (#2381)
Warning is more appropriate per: https://github.com/grpc/grpc-go/blob/master/Documentation/log_levels.md#warning
2018-10-17 14:44:02 -07:00
23d111fa0d Health server watch method (#2365)
Implements the Watch method of Health server and it's end2end tests.
2018-10-16 14:39:16 -07:00
cfb9600851 server: fix handling of RPC timeouts that overflow int64 nanos (#2379)
Fixes #2374
2018-10-16 13:34:53 -07:00
557b6b5f68 healthcheck: client-side internal hook (#2378) 2018-10-15 17:57:20 -07:00
1da8e51941 transport: http2Client sends RST_STREAM (#2354)
If http2Client receives END_STREAM before it sends END_STREAM, it will send RST_STREAM to fully closed the stream.
2018-10-15 14:28:12 -07:00
f1b28afd42 doc: add faq for logging and "transport is closing" error (#2372) 2018-10-15 13:28:48 -07:00
dfaadfecca server: handleStream() cleanup (#2352) 2018-10-15 13:27:22 -07:00
371811880c balancer: add clarifying note to PickOptions.Header (#2377) 2018-10-15 10:27:54 -07:00
5b2c343e0b add header metadata to PickOptions (#2376) 2018-10-12 15:44:20 -07:00
1ca9df53a7 internal: clean up and unflake state transitions test (#2366)
internal: clean up and unflake state transitions test

Switches state transitions test to using a notification from a custom load
balancer, instead of relying on waiting for laggy balancer state updates.

Also generally adds more coverage around state transitions and a framework
for easily adding more of these kinds of tests.

Fixes #2348
2018-10-12 15:22:27 -07:00
5a2acb1f52 channelz: remove init logging (#2373) 2018-10-12 14:34:08 -07:00
c05280cc73 cleanup: remove unused channel ready (#2353) 2018-10-11 13:10:45 -07:00
dc3d58fc3e retry go get when it fails (#2345) 2018-10-11 13:07:48 -07:00
cb11627444 clientconn: not panic when service config updated while closing (#2371)
Closing `ClientConn` sets `balancerWrapper` to nil.
If service config switches balancer, the new balancer will be notified of the existing addresses.

When these two happens together, there's a chance that a method will be called on the nil `balancerWrapper`. This change adds a check to make sure that never happens. 

fixes #2367
2018-10-11 11:43:16 -07:00
c1fc9faff6 refactor variable name (#2369)
Refactor `status` variable name to `servingStatus` to avoid the complaint from Goland IDE about name conflict from the `status` package.
2018-10-11 10:14:31 -07:00
c195587d96 balancer: add trailer metadata to DoneInfo (#2359) 2018-10-10 13:21:08 -07:00
55cdff2adc test: add test for picker DoneInfo.Err (#2358) 2018-10-09 13:53:11 -07:00
8d75951f9b Fix onclose state transition (#2346)
internal: fix onClose state transitions

When onClose occurs during WaitForHandshake, it should immediately
exit createTransport instead of leaving CONNECTING and entering READY.

Furthermore, when any onClose happens, the state should change to
TRANSIENT FAILURE.

Fixes #2340
Fixes #2341

Also fixes an unreported bug in which entering READY causes a
Dial call to end prematurely, instead of blocking until a READY
transport is found.
2018-10-08 16:58:54 -06:00
0361d80ffd server: reuse function recv() in processUnary (#2351)
This change splits recv() into two functions so it can be used by processUnary.
2018-10-08 13:55:04 -07:00
179dc63634 testing: fix race caused by successful Accept on a shutdown server (#2321) 2018-10-04 13:26:25 -07:00
30f4150eec service config: Avoid logging a warning on empty serviceconfig. (#2316) 2018-10-04 13:25:25 -07:00
431e4028c5 Provide a fake grpclb balancer server that can be used for testing (#2338) 2018-10-02 18:26:40 -07:00
ad6d187e37 keepalive: godoc improvement and behavior explanation (#2342) 2018-10-02 13:03:51 -07:00
945824a2e5 credentials/alts: Minor typo fix (#2344) 2018-10-02 10:00:23 -07:00
fdc936c6b5 lint: add package comment for package google (#2343) 2018-10-01 10:44:27 -07:00
b48e364c83 client: read from Conn while writing preface to unblock synchronous Conns (#2337) 2018-09-28 10:38:48 -07:00
cc41663c52 client: fix panic caused by WithWaitForHandshake and related races (#2336) 2018-09-27 14:23:29 -07:00
f8063d3b62 tests: fix leak in TestDialParseTargetUnknownScheme (#2320)
Do a non-blocking send so if dial is called again in a retry, it won't block forever.
2018-09-27 13:50:06 -07:00
a338994886 binarylog: implement env variable config parsing (#2299) 2018-09-26 13:03:54 -07:00
7fea98ede7 Add lock.yml for locking closed, stale PRs/issues (#2331) 2018-09-25 14:15:54 -07:00
4dedfdc82c credentials: support google default creds (#2315)
Google default creds is a combo of ALTS, TLS and OAuth2. The right set of creds will be picked to use based on environment.

This PR contains:
 - A new `creds.Bundle` type
   - changes to use it in ClientConn and transport
   - dial option to set the bundle for a ClientConn
   - balancer options and NewSubConnOption to set it for SubConn
 - Google default creds implementation by @cesarghali 
 - grpclb changes to use different creds mode for different servers
 - interop client changes for google default creds testing
2018-09-25 13:17:25 -07:00
ebea9b5bbc resolver/dns: support custom dns authority (#2265) 2018-09-25 10:45:03 -07:00
30212c8423 internal: fix various problems in transport_test.go
Commit 35c3afad17f705e725ca04bff658932689920154 added a `defer cancel()` line
to transport_test. While this line is generally good, there happens to be a
Go 1.6 bug that when a context that gets passed into Dial is canceled, it
has a 50% chance to incorrectly causes all future Dial writes to fail.

This commit removes that defer and adds a comment explaining the situation.

https://github.com/golang/go/issues/15078
https://github.com/golang/go/issues/15035

This commit also fixes a perceived (by the race detector) racy use of
server.conn by making conn.Close happen inside the goroutine that
uses conn.

This commit also fixes a SIGSEV caused by an incorrect typed nil
check.
2018-09-24 10:46:24 -07:00
82f263dc2f internal: fix race between cancel and shutdown
This fixes a race in ac.tearDown and ac.resetTransport. If ac.resetTransport
is in backoff when ac.tearDown occurs, there's a race between the state
changing to Shutdown and ac.resetTransport calling ac.createTransport.

This fixes it by returning when ac.resetTransport encounters an error
during ac.nextAddr (specifically ac.ctx.Error()). It also fixes it by
making sure that ac.tearDown changes state to Shutdown before canceling
the context.

Both fixes were implemented because they both seem to be valuable
standalone additions: the former makes ac.resetTransport more
understandable and less dependent on behavior happening elsewhere,
and the latter makes ac.tearDown more correct.

Finally, TestDialParseTargetUnknownScheme had its buffer removed; the
buffer was likely added a while ago to assuage this issue. It should
not be necessary anymore.
2018-09-24 10:46:24 -07:00
8997b5fa08 credentials/alts: Pass the target name to ALTS handshaker (#2319) 2018-09-20 16:48:47 -07:00
35c3afad17 Transport refactor (#2305)
internal: remove transportMonitor, replace with callbacks

This refactors the internal http2 transport to use callbacks instead
of continuously monitoring the transport in a separate goroutine. This
has several advantages:

- Less goroutines.
- Less complexity: synchronous callbacks are much easier to reason to
reason about than asynchronous monitoring goroutines.
- Callbacks: these provide definitive locations for monitoring the
creation and closure of a transport, paving the way for GracefulStop.

This CL also consolidates all the logic about backoff and iterating
through the list of addresses into a single method.
2018-09-20 15:45:40 -07:00
0baa06717e tests: fix goroutine leak (#2317)
tests: fix goroutine leak

If TestResetConnectBackoff fails, the resetTransport goroutine will be
stuck dialing and subsequently the goroutine will be leaked. This is
all despite the test including `defer cc.Close()`:

- defer cc.Close() will cause ac.cancel to be called
- ac.context will be appropriately cancelled
- ac.context is correctly the context that gets passed to the dialer
- However, the WithDialer throws away the context and only passes its
deadline, which is for `backoffForever{}` is math.MaxInt64. So, even
though teardown occurs, the resetTransport goroutine will still be
stuck dialing.

This CL adds a small amendment: before performing leakcheck, attempt
to take an item off the synchronous `dials` channel. Either the tests
passed and there is no item, or the tests failed and there is one.
2018-09-20 15:26:05 -07:00
8ce7e6babb stream: never return errors from CloseSend (#2312) 2018-09-19 08:44:26 -07:00
be59908d40 testing: upgrade appengine sdk to version 1.9.68 (#2311)
Make goapp use go version 1.9.
2018-09-18 10:42:17 -07:00
bd04c06895 vet: move go_vet directory under test directory (#2310) 2018-09-17 15:03:21 -07:00
0ec11dceb4 typo: remove duplicate "the" (#2309) 2018-09-17 14:01:20 -07:00
f2aaa9bf74 Check error when calling compressor.Compress (#2274)
Compress can return an error, which was not checked.
2018-09-14 08:57:13 -07:00
acd1429515 channelz: channel tracing (#2262)
* channelz: channel trancing

* add service

* update

* uuu

* better testing

* switch to single API

* fix lint

* fix review comments

* fix fix review

* uuuupdate

* switch on channel type, instead of using boolean
2018-09-12 11:15:32 -07:00
9cc4fdbde2 Change version to 1.16.0-dev (#2303) 2018-09-11 11:35:35 -07:00
d42ac64492 move tools.go to sub-package (#2300)
`godep` by default pulls in all dependencies regardless of build tags.  If `tools.go` is in our main package, that can cause unnecessary dependencies to be pulled into others' repos that otherwise don't need them.  Moving it to an unused sub-package appears to fix this problem.
2018-09-11 10:33:48 -07:00
46ee6abebf import check for appengine environment(#2215) 2018-09-10 17:32:46 -07:00
5fe5ce74bb credentials/alts: Export test APIs (#2293) 2018-09-07 11:05:56 -07:00
16df5a3328 credentials/alts: Rename core package to internal (#2296) 2018-09-07 10:24:15 -07:00
0150fc5d50 credentials/alts: Move alts/core to alts/internal (#2292) 2018-09-05 15:15:42 -07:00
5fe10fccaf Remove unused symbols (#2287) 2018-09-05 12:29:02 -07:00