2713 Commits

Author SHA1 Message Date
c86bc5cd5f health: Checks if the service's serving status has changed before sending an update (#2424) 2018-10-31 15:45:18 -07:00
6572a802a1 internal: update golint to use new url (#2393) 2018-10-31 14:39:18 -06:00
3332afdfad internal: binarylog test replace += 1 with ++ (#2420) 2018-10-31 13:34:00 -07:00
24638f5984 binarylog: call binary log in Client and Server (#2388)
Also includes:
 - Export `NewLoggerFromConfigString` so it can be also used when config string is specified in another way (e.g. command line flag)
 - Export `Logger` so user can install custom sink
 - Add temp file sink implementation
2018-10-31 10:21:20 -07:00
a88340f3c8 internal: add testutils package comment (#2414) 2018-10-30 16:29:06 -07:00
c4d3b2fa07 channelz: register sockets with meaningful refnames (#2416) 2018-10-30 16:28:48 -07:00
ec76f14f6f health: Merges healthcheck package to health package. (#2417) 2018-10-30 16:08:45 -07:00
582d1c9bbf healthcheck: add package comment (#2413) 2018-10-30 10:19:40 -07:00
aaaaffa63b channelz: data race fix (#2411) 2018-10-29 17:54:21 -07:00
0430365f23 channelz: update generated proto stubs 2018-10-29 16:33:56 -07:00
f86585f6f5 channelz: update generated proto stubs (#2408) 2018-10-29 10:24:39 -07:00
1b1c45ef21 internal: vet cleanups (#2405)
- Take advantage of `grep`'s status code, where possible
- Make the appengine check in vet.go exit with non-zero status if an error is encountered
- Add "fail_on_output" for the `tee|read` that we do when the status code cannot be used, to make it clear what it's for
- Document all our various checks
2018-10-26 15:50:46 -07:00
e16607685d healthcheck: clientHealthCheck and its unit test (#2389)
Adds clientHealthCheck and a unit test for exponential backoff functionality.
2018-10-26 13:00:42 -07:00
425c07e59b internal: add check for import of ptypes proto packages (#2396) 2018-10-26 09:40:02 -07:00
ecb5db9eb3 channelz: returns sockets after startID in GetServerSockets() (#2401) 2018-10-25 16:39:43 -07:00
d7518259e0 Change version to 1.17.0-dev (#2399) 2018-10-23 11:07:38 -07:00
e120c3f900 internal: transport nil should happen before backoff (#2392)
Seems to fix https://travis-ci.org/grpc/grpc-go/jobs/443409852, but regardless
it's a more correct place for it to happen.
2018-10-22 13:57:57 -07:00
93a2ad2c87 internal: rename proto imports to pb (#2395) 2018-10-22 13:55:52 -07:00
ff2aa05958 internal: fix GO_AWAY deadlock (#2391)
internal: fix GO_AWAY deadlock

A deadlock can occur when a GO_AWAY is followed by a connection closure. This
happens because onClose needlessly closes the current ac.transport: if a
GO_AWAY already occured, and the transport was already reset, then the later
closure (of the original address) sets ac.transport - which is now healthy -
to nil.

The manifestation of this problem is that picker_wrapper spins forever trying
to use a READY connection whose ac.transport is nil.
2018-10-19 14:11:21 -07:00
39444b99c0 binarylog: implement methodlogger (#2334)
Method logger will be picked by each RPC at the beginning to log binary entries. It also handles truncating.

This PR also adds script to download proto from grpc/grpc-proto
2018-10-18 17:27:11 -07:00
0ee1544089 cleanup: remove ac.events (unused) and related dead code (#2385) 2018-10-18 16:29:41 -07:00
13b2b26aae internal: update proto generated code (#2386) 2018-10-18 15:45:22 -07:00
04c0c4d299 internal: fix client send preface problems (#2380)
internal: fix client send preface problems

This CL fixes three problems:

- In clientconn_state_transitions_test.go, sometimes tests would flake because there's not enough buffer to send client side settings, causing the connection to unpredictably enter TRANSIENT FAILURE. Each time we set up a server to send SETTINGS, we should also set up the server to read. This allows the client to successfully send its SETTINGS, unflaking the test.

- In clientconn.go, we incorrectly transitioned into TRANSIENT FAILURE when creating an http2client returned an error. This should be handled in the outer resetTransport main reset loop. The reason this became a problem is that the outer resetTransport has very specific conditions around when to transition into TRANSIENT FAILURE that the egregious transition did not have. So, it could transition into TRANSIENT FAILURE after failing to dial, even if it was trying to connect to a non-final address in the list of addresses.

- In clientconn.go, we incorrectly stay in CONNECTING after `createTransport` when a server sends its connection preface but the client is not able to send its connection preface. This CL causes the addrconn to correctly enter TRANSIENT FAILURE when `createTransport` fails, even if a server preface was received. It does so by making ac.successfulHandshake to consider both server preface received as well as client preface sent.
2018-10-18 14:31:34 -07:00
481c28e8d4 documentation: add proxy doc (#2357) 2018-10-18 13:09:24 -07:00
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