Commit Graph

3300 Commits

Author SHA1 Message Date
Ze'ev Klapow 9111602d7c StreamObservers: make sure onComplete only gets called once from onReadyHandler
Fixes #4558
2018-12-05 12:59:09 -08:00
ZHANG Dapeng b8fac8a75e
doc: s/GrpcServerRule/GrpcCleanupRule in README 2018-12-05 12:43:02 -08:00
Jihun Cho c0d4e022f4 Update README to reference 1.17.0 2018-12-05 10:03:43 -08:00
ST-DDT 0dda74dda4 core: Fix deprecation warning in RoundRobinLoadBalancerFactory 2018-12-05 10:03:02 -08:00
ZHANG Dapeng 0c95dad0da
core: fix bazel NameResolverProvider not found 2018-12-05 09:45:41 -08:00
Kun Zhang 5054aefe03
core: support LoadBalancingConfig from Service Config (#5073) 2018-12-04 16:56:06 -08:00
ZHANG Dapeng 00b4b8870b
examples: move alts bazel and rm alts from pom.xml 2018-12-03 17:12:30 -08:00
Rodrigo Queiro dd89dba8e9 bazel: use new http_archive
The old native.http_archive is disabled by default in Bazel 0.20.0.
2018-12-03 16:35:10 -08:00
ZHANG Dapeng f5b63d703c
examples: make corrections to document of helloworld tls example 2018-12-03 15:08:59 -08:00
ZHANG Dapeng c31f4f1ddf
examples: move alts example to a separate directory 2018-12-03 14:59:07 -08:00
ZHANG Dapeng e9ba65a42e
all: sync tcnative version
The helloworld TLS example can not run properly with the outdated examples/build.gradle.
2018-12-03 13:19:17 -08:00
ZHANG Dapeng 8ecdec73fd
examples: prefer implementation to compile in build.gradle 2018-12-03 10:01:19 -08:00
Venil Noronha 3f4c3f0406 stub: disable exception if onCancelHandler set
This restrains a cancellation Exception when an onCancelHandler
is set in ServerCallStreamObserverImpl.

Signed-off-by: Venil Noronha <veniln@vmware.com>
2018-11-30 18:36:12 -06:00
Arnout Engelen 3dab7aed2f netty: Client-side support for h2c via Upgrade
Fixes #4518
2018-11-30 18:10:27 -06:00
Kun Zhang b5acbedd55
core: record real-time metrics to OpenCensus (updated to 1.18.0) (#5099)
Real-time metrics are total sent/received bytes and messages per
method, and are updated as the events occur rather than at the end of
RPCs.
2018-11-29 16:30:58 -08:00
Kun Zhang 2961857451
core: refactor flags in CensusStatsModule. (#5095)
There are currently three boolean flags, and there will be one more
soon.  Put them all in the top-level class instead of passing them as
arguments on lower levels.
2018-11-28 14:20:40 -08:00
Carl Mastrangelo 81121fd8e4
alts: make sure to always free frame protector 2018-11-28 11:52:27 -08:00
Kun Zhang 98ae834dfa
core: use SynchronizationContext.schedule() for NameResolver refresh (#5089)
This also fixes the bug where NameResolverRefresh is not run from
syncContext if run from ScheduledExecutorService.
2018-11-28 09:42:29 -08:00
Kun Zhang 3ff4790212
core: allow ClientStreamTracer to intercept trailers. (#5088)
This would allow LoadBalancers to intercept trailers which could carry
load information.
2018-11-27 12:47:31 -08:00
ZHANG Dapeng 13c9216ddd
doc: improve javadoc of GrpcServerRule in favor of GrpcCleanupRule 2018-11-27 11:06:18 -08:00
ZHANG Dapeng 3c685062b7
build: if('false') is not equivalent to if(false) in gradle 2018-11-21 15:03:54 -08:00
ZHANG Dapeng 4d80886231
all: exclude internal/testing package from jacoco coverage report 2018-11-21 15:03:13 -08:00
Kun Zhang c8b2cdc023
core/services: test/debug friendlier (#5079)
Raise visibility of AutoConfiguredLoadBalancerFactory as internal
tests need to access it from a different package.

Rename HealthCheckingLoadBalancerFactory.LoadBalancerImpl to
*.HealthCheckingLoadBalancer so that its toString() output is more
informative.
2018-11-21 10:45:18 -08:00
ZHANG Dapeng 0c38d1877a
buildscripts: Add CI for kotlin non-android
- add CI for kotlin non-android
- bump kotlin version to fix kotlin compiler issue on jdk11
- add javax.annotation dep to fix kotlin build on jdk 9 & 11

Fixes #4725
2018-11-20 13:20:45 -08:00
Kun Zhang 268793f321
core: add (de)register() in LoadBalancerRegistry. (#5070) 2018-11-20 12:07:31 -08:00
zpencer 777bbbb121
core: TimeProvider should not assume that the clock never changes (#4883)
We should reflect changes in the system clock.
2018-11-20 11:34:58 -08:00
ZHANG Dapeng 6b15aa9e4e
core: implement hedging 2018-11-20 09:38:01 -08:00
Jihun Cho 1506135333 Start 1.18.0 development cycle 2018-11-19 14:49:35 -08:00
Eric Anderson 033cf21118 core: Explicitly mention MCB.intercept's execution order
New users are much more likely to use MCB to add an interceptor instead
of ClientInterceptors, so may not be aware of the interesting execution
order.
2018-11-19 11:02:44 -08:00
Jihun Cho ab5257504b
core: use fakeClock in MessageDeframer tests to fix flaky test (#5055) 2018-11-14 15:13:10 -08:00
zpencer ea9bdabcb2
services: use Durations.toNanos instead of Duration.getNanos (#5059)
getNanos will return the fractional nanos of the duration, which is
not the same as toNanos for durations larger than 1s.
2018-11-14 10:06:04 -08:00
Kun Zhang 02f0dca8d4
Fix buildifier warnings (#5058) 2018-11-14 07:12:11 -08:00
Kun Zhang 5b87e99622
core: move round-robin to util and include it to hard-coded list (#5057)
This is needed for internal issue b/119247688.

A particular test that runs GRPC Android build in a non-Android
environment failed because RoundRobinLoadBalancerProvider was deleted
by ProGuard but the service-loader META-INF file still referred to it,
causing a loading failure.

This could be fixed by adding RoundRobinLoadBalancerProvider to the
hard-coded list, which is recognized by ProGuard then it will keep the
class.

However, we don't expect anyone to use RoundRobinLoadBalancerProvider
on Android, including the class on Android would increase code size,
which Android apps are sensitive to. Hence we move
RoundRobinLoadBalancerProvider to a different package (util), which is
built as a separate artifact internally which Android users usually
don't depend on. (Note that in open-source util is in the same artifact as core,
which is unfortunately).
2018-11-13 17:06:01 -08:00
Nicholas DiPiazza 7c05127cbc netty: Add to "An established connection was aborted by the software in your host machine" QUIET_ERRORS 2018-11-13 14:13:36 -08:00
Rodrigo Queiro 8481943866 Add missing j2objc dependency to Bazel build
This avoids a warning when building artifacts that depend on Guava.

Fixes #5046.
2018-11-13 13:39:35 -08:00
Jihun Cho b78036daaa
netty: finalize maxMessageSize deprecation in NettyChannelBuilder. (#5054) 2018-11-13 10:59:15 -08:00
ST-DDT 417c41b6cb stub: fix null check in MetadataUtils.
Fixes #5045
2018-11-13 08:35:47 -08:00
Eric Anderson 7a89ce2a90 Lint fixes
Remove unused variables and prefer ArrayDeque to LinkedList. The swap to
Queue from Deque was just to make it more obvious what the usage was,
since the original swap to Deque was to avoid the same LinkedList lint
violation (3d51756d).
2018-11-09 17:15:25 -08:00
Yang Song 09b13fecaa core: Update OpenCensus version to 0.17.0 (#4494) 2018-11-09 16:44:01 -08:00
Eric Anderson 4064123e0b Bump Jetty ALPN to 2.0.9
This adds support for Java 1.8.0_191 and 192
2018-11-09 15:41:30 -08:00
Kun Zhang 31af0657d0
services: cancel health-check when LoadBalancer.shutdown() is called. (#5051)
The health checking balancer won't receive an update about Subchannel
shutdown via handleSubchannelState(), because no more callback will be
called after LoadBalancer.shutdown() is called.
2018-11-09 14:51:36 -08:00
ZHANG Dapeng bff008fbc8
core: Emit bin-headers with unpadded encoding
Following the [grpc PROTOCOL-HTTP2 spec](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md)
"Note that HTTP2 does not allow arbitrary octet sequences for header values so binary header values must be encoded using Base64 as per https://tools.ietf.org/html/rfc4648#section-4. Implementations MUST accept padded and un-padded values and should emit un-padded values. "
2018-11-09 13:39:01 -08:00
Eric Gribkoff cab5966415
okhttp: error in frame handler closes with INTERNAL (#5049) 2018-11-09 08:48:13 -08:00
Kun Zhang 11154074bd
services: HealthCheckingLoadBalancer logs to ChannelLogger (#5042)
Log the event that health check is disabled due to UNIMPLEMENTED as required in the spec:
https://github.com/grpc/proposal/blob/master/A17-client-side-health-checking.md

Also log every Subchannel state change that is affected by health-checking, i.e., the state changes when the raw Subchannel state is READY and health-check is running.

Tracking issue: #4932
2018-11-08 15:16:52 -08:00
Jihun Cho a7196eb311
core: remove I/O from DNS test which caused flaky test (#5044) 2018-11-07 16:00:26 -08:00
Carl Mastrangelo e7e88a9af8
core: narrow SharedResourceHolder types, and make the scheduler unconfigurable 2018-11-07 13:12:21 -08:00
Kun Zhang 21bd098d7b
services: annotate HCRRLBP with RunWith (#5039) 2018-11-07 11:37:26 -08:00
Kun Zhang 6b48eb4e08
core: ChannelLogger (#5024)
Introduce ChannelLogger, which is a utility provided to LoadBalancer implementations (potentially NameResolvers too) for recording events to channel trace. This is immediately required by client-side health checking (#4932, https://github.com/grpc/proposal/blob/master/A17-client-side-health-checking.md) to record an error about disabling health checking. It is also useful for any LoadBalancer implementations to record important information.

ChannelLogger implementation is backed by the internal ChannelTracer/Channelz. Because Channelz limits the number of retained events, and events are lost once the process ends, I have expanded it to also log Java logger. This would provide a "last resort" in cases where there are too many events or off-line investigation is needed. All logs are prefixed with logId so that they can be easily associated with the involved Channel/Subchannel.

To prevent log spamming, the logs are all at FINE level or below so that they are not visible by default. They are logged to ChannelLogger's logger, so that user can have precise control.

There are also more verbose information that may not fit in ChannelTracer, but can be useful for debugging. It's desirable that these logs are associated with logId, but they currently manually include the logId, which is cumbersome and may result in inconsistency. For this use case, I added the DEBUG level for ChannelLogger, which formats the log in the same way as other levels, while not recorded to Channelz.

I have converted most logging and channel tracer recording in the Channel implementation and LoadBalancers.
2018-11-06 16:48:09 -08:00
Jihun Cho 80c973cbd5
okhttp: Optimize memory usage by mergeing buffers (#5023)
okhttp: Optimize memory usage by mergeing buffers

OkHttp transport's memory useage by merging Buffers for each pending data.
- OutboundFlowController, OkHttpClientStream

NOTE: Buffer by default allocate 4k memory.
2018-11-06 11:01:20 -08:00
Jan Tattermusch e2e990b01a
benchmarks: driverServer graceful shutdown (#5033) 2018-11-06 19:07:15 +01:00