Commit Graph

3245 Commits

Author SHA1 Message Date
Jihun Cho 1c3432c3fb
all: migrate gradle publish from maven to use maven-publish plugin (#5289) 2019-01-31 17:38:43 -08:00
Eric Anderson c75d9bc19f core: Fix racy creation/set of the retry Future
This fixes two races: a data race where scheduledRetry is accessed
by cancel() and confusion where scheduledRetry could be set to null by
the schedule()d runnable before it is set by the schedule() return
value.

Although it seems these races can't actually cause problems due to other
conditions/constraints, it's hard to reason about. So let's plug these
preemptively, even if we can't add tests that trigger them.

ScheduledHedging was not specific to hedging, so can now be reused for
this retry case. It was renamed to avoid being misleading.
2019-01-31 16:24:34 -08:00
ZHANG Dapeng d0ecc08705
all: fix lint 2019-01-31 09:31:13 -08:00
Eric Anderson 473a7d1ce7
interop-testing: Simply ProxyTest and shutdown handling 2019-01-30 16:23:26 -08:00
Eric Gribkoff b7cf75fac1
cronet: avoid NPE in writeHeaders after transport shutdown (#5275) 2019-01-30 11:01:30 -08:00
Jihun Cho 9c796ac23d examples: fix the logger name to match actual class. This PR was originally made by chengsluo (#5159) 2019-01-30 10:42:19 -08:00
Carl Mastrangelo ed0a9f3f1d
netty: support listening on multiple ports 2019-01-29 10:13:40 -08:00
Eric Anderson 4ba168f28a
SECURITY.md: Rewrite/reflow our recommendations
Much of these sections pre-dated gRPC 1.0 and Java 9. Modernize them to be more
on-point and clear.
2019-01-28 16:26:44 -08:00
Eric Anderson 55b08e67d4 context: Avoid leaking ClassLoader through ThreadLocal 2019-01-28 13:54:52 -08:00
Carl Mastrangelo 27253353e7
core: fix service config prefix matching in Dns
Fixes #5280
2019-01-28 12:46:23 -08:00
Eric Gribkoff ce2ae1fb6c
core: remove channel reference from ManagedChannelWrapper (#5283)
This avoids a memory leak when the channel itself participates in a
reference cycle (e.g., when an interceptor retains a reference to an
Android app's context). With the current implementation, the static
`ManagedChannelOrphanWrapper.refs` map will keep the channel reachable
and prevent the ref cycle from being GCed.
2019-01-25 16:36:04 -08:00
Eric Gribkoff f973bbc06f
Revert "buildscripts: disable android size status check (#5278)" (#5284)
This reverts commit aaa3a86dd2.
2019-01-25 16:16:41 -08:00
Carl Mastrangelo 6c8020e584
all: fix formatting on bzl file 2019-01-25 16:13:46 -08:00
Carl Mastrangelo f6689a1f86
all: fix lint errors 2019-01-25 16:09:59 -08:00
Carl Mastrangelo 32fc0bcd38
services: set the default serving state of all services to SERVING 2019-01-24 15:19:51 -08:00
Eric Gribkoff aaa3a86dd2
buildscripts: disable android size status check (#5278) 2019-01-24 12:21:58 -08:00
Eric Anderson c2f8d83663
gae-interop-testing: Remove jdk7 test
GAE Java 7 is dead as of January 16.
https://cloud.google.com/appengine/docs/deprecations/java7
2019-01-24 08:54:47 -08:00
Eric Gribkoff 1d97b50315
core: do not lose status when RST_STREAM with NO_ERROR received (#5264) 2019-01-24 08:50:09 -08:00
Ignacio del Valle Alles 3a38e59bae core: Allow specifying a ProxyDetector per ManagedChannel 2019-01-23 16:57:40 -08:00
Carl Mastrangelo 3d2e375aa1
core: drop VisibleForTesting on ServiceConfigUtil 2019-01-23 15:10:50 -08:00
ZHANG Dapeng 66c3c2911c
grpclb: a minor code cleanup 2019-01-23 13:22:43 -08:00
Carl Mastrangelo d7659411eb
interop-testing: deflake MoreInProcessTest 2019-01-22 18:00:14 -08:00
Jihun Cho 0e32152229 okhttp: throws correct exception in AsyncSink when write/flush happened before
connected. This change will suppress NPE logs when the transport encountered
any error during connection phrase.
2019-01-22 17:03:58 -08:00
Kun Zhang abdae25c8d
services: log an error to java logger when health-check disabled. (#5261)
This is required by the spec:
https://github.com/grpc/proposal/blob/master/A17-client-side-health-checking.md
2019-01-22 15:17:56 -08:00
Carl Mastrangelo 985bf0aa74
netty: handle racy stream cancellation on already failed transports 2019-01-22 15:15:35 -08:00
ZHANG Dapeng f0fc57878d
build: fix javadoc failure for java 11 2019-01-22 10:35:19 -08:00
Carl Mastrangelo 6f83bfc393
netty: handle reentrant exception in WBAEH 2019-01-18 15:18:31 -08:00
Eric Anderson 5dbe53c050 core: Remove incorrect usages of VisibleForTesting
The visibility is (correctly) used in non-testing scenarios.
2019-01-15 18:58:43 -08:00
ZHANG Dapeng b1fbbb675a
xds: do not upload archives for xds for now 2019-01-15 16:42:51 -08:00
Eric Anderson e06b941eb7 alts,services: Sync proto sources from grpc-proto
This syncs to grpc/grpc-proto@f9af5e19f7
2019-01-15 16:15:22 -08:00
Carl Mastrangelo 3e6d8dc456
netty: handle unexpected handlerRemoved in WBAEH 2019-01-15 14:28:41 -08:00
ZHANG Dapeng f17a7c0faf
Update README to reference 1.18.0 2019-01-15 10:54:22 -08:00
Eric Anderson ca41aeaac9 core: Use Truth's isEmpty/hasSize
It produces clearer result error messages where there are failures.
2019-01-14 17:00:16 -08:00
ZHANG Dapeng 788cdbd511
buildscripts: Show bazel version in CI 2019-01-14 16:54:51 -08:00
Carl Mastrangelo 659b78b06c
netty: move buffering logic from ProtocolNegotiators
This is part 1 of a larger change to simplify channel initialization.  Part two will be to let Protocol negotiators install themselves in a deterministic manner and delegate error handling to the exception handler.

Changes:

1.  Copied most of AbstractBufferingHandler to WriteBufferingAndExceptionHandler. WBAEH does not handle adding more than one handler.  Eventually, pipeline initialization will happen in the protocol negotiator rather than in each handler.
2.  Added tests for error handling.
3.  The WBAEH is always added to the NettyClientTransport.  This means for a brief period, there will be double buffering on the pipeline.  The buffering should go away after part 2.
2019-01-11 18:42:12 -08:00
Eric Anderson bcd2372280 core: disable SRV records lookup
SRV has not yet been enabled in a release. Since work is rapidly
underway to replace GRPC-LB with a service config+XDS-based solution,
there's now thoughts that we won't ever enable grpclb by default (but
may allow it to be automatically enabled when using GoogleDefaultChannel
or similar). Since things are being worked out, disable it.

This effectively reverts c729a0f.
2019-01-11 15:13:33 -08:00
Jiangtao Li 4d90b37a0a
ALTS: release handshaker channel if no longer needed (#5210)
* ALTS: release handshaker channel if no longer needed
2019-01-11 14:57:08 -08:00
ZHANG Dapeng 7a547276da
xds: import from envoy and add ads.proto and lrs.proto 2019-01-11 14:46:04 -08:00
Eric Anderson c8817cf284
kokoro: Reduce gradle workers on Mac to reduce flakes
We've had a long run of test timeout failures on Mac with timeouts in
the seconds. Multiple of these haven't seemed like races, but simply
that the Mac machines were too slow. The most recent case for this is a
set of timeouts for
OkHttpTransportTest.earlyServerClose_serverFailure_withClientCancelOnListenerClosed
where it took over a second for a server stream to be created ("Timed
out waiting for server stream").

This commit reduces the number of workers to reduce the overall load,
hoping this lets tests complete within a reasonable amount of time.
2019-01-11 08:56:45 -08:00
ZHANG Dapeng 97218a6edd
examples: Not to promise a supported Bazel version
It's not maintainable.
2019-01-11 08:56:08 -08:00
Kun Zhang 1ed196c585
core: promote the new API in CallCredentials2 (#5216)
This is the 3rd step of #4901

- The deprecated `CC.applyRequestMetadata(... Attributes ...)` is now **replaced** by the new API `CC.applyRequestMetadata(... CC.MetadataApplier ...)` transformed from `CC2.applyRequestMetadata(... CC2.MetadataApplier ...)`.
- The Attributes keys in `CallCredentials` were deprecated, and now deleted.
- The deprecated interface `CC.MetadataApplier` is **replaced** by an equivalent abstract class.
- `CallCredentials2` is now marked as deprecated, while keeping its interface intact so that it won't break current implementations that are still on `CallCredentials2`.
- From this point on, implementations should do a one-line change from `extends CallCredentials2` to `extends CallCredentials`
- `GoogleAuthLibraryCallCredentials` is kept as `CallCredentials2` for now, as there is an internal consumer that expects it to be `CallCredentials2`.
2019-01-10 15:16:18 -08:00
Kun Zhang 7475b7f110
core: fix a channel panic bug caused by calling NameResolver.refresh() when it's not started (#5223)
Resolves #5222
2019-01-10 11:28:58 -08:00
Jihun Cho 08218810fd Remove @VisibleForTesting, because NettyServerTransport is referencing it 2019-01-08 17:27:29 -08:00
Eric Anderson 4adcf24363
Downgrade to Guava 25.1
This is temporary for the 1.18 release to give users a bit more time to
get past the breaking changes to Beta APIs in Guava 26.

Fixes #5166
2019-01-08 16:22:48 -08:00
Eric Anderson e74576b85b Remove old BetaApi failure suppressions
We've been on newer versions of Guava for a while now; these no longer
do anything.

Reworded the comment for Stopwatch.createUnstarted(), because it is not
safe (it doesn't matter if the method isn't marked Beta; you have to use
Ticker), except for the fact it is only used in our tests.
2019-01-08 16:07:40 -08:00
Jihun Cho 08efd978d7
all: remove duplicated dependency (#5207) 2019-01-03 10:50:44 -08:00
ZHANG Dapeng 4337da6d7d
Start 1.19.0 development cycle 2019-01-02 15:31:01 -08:00
Carl Mastrangelo b6af40e510 examples,netty: fix lint errors 2019-01-02 15:30:31 -08:00
ZHANG Dapeng df21e40285
all: fix lint 2019-01-02 15:28:44 -08:00
ZHANG Dapeng 56e980cb29
okhttp: fix MockitoAnyIncorrectPrimitiveType error in test 2019-01-02 11:41:41 -08:00