Commit Graph

2738 Commits

Author SHA1 Message Date
ZHANG Dapeng 02c4fa01c6
testing: GrpcCleanupRule
This will ease a lot of test scenarios that we want to automatically shut down servers and channels, with much more flexibility than `GrpcServerRule`. Resolves #3624

**ManagedChannel/Server cleanup details:**
- If the test has already failed, call `shutdownNow()` for each of the resources registered. Throw (an exception including) the original failure. End.
- If the test is successful, call `shutdown()` for each of the resources registered.
- Call `awaitTermination()` with `timeout = deadline - current time` and assert termination for each resource.  If any error occurs, break immediately and call `shutdownNow()` for the current resource and all the rest resources.
-  Throw the first exception encountered if any.
2018-04-30 17:15:52 -07:00
Carl Mastrangelo 045c566b88
netty: bump to 4.1.24-Final 2018-04-30 16:55:52 -07:00
ZHANG Dapeng b58e0f4059
core: stickiness for RoundRobinLoadBalancer
Add weak stickiness support for Round Robin lb.
2018-04-30 16:46:35 -07:00
Carl Mastrangelo 2b6edfc79d
grpclb: move load balancer proto to package-matching directory 2018-04-30 16:14:32 -07:00
Jorg Heymans 48f103c1ed examples: remove deprecated usage of usePlainText(boolean) (#4396)
Update examples (including android) to use non deprecated version of method.
2018-04-30 16:12:41 -07:00
Carl Mastrangelo 6bd5582175
services: update channelz with docs from upstream 2018-04-30 15:26:36 -07:00
Carl Mastrangelo b0333c6588
benchmarks: move proto to matching package structure 2018-04-30 14:12:53 -07:00
Carl Mastrangelo 017399027e
android-interop-testing: normalize integration proto directories 2018-04-30 11:31:10 -07:00
Carl Mastrangelo 26581562f0
interop-testing: normalize integration proto directories 2018-04-30 11:30:49 -07:00
Eric Gribkoff 785ac4772e
README.md: clarify that Android is for client-side use (#4408) 2018-04-30 10:28:41 -07:00
Eric Gribkoff 1ad11c1008
android: avoid static init of robolectric shadows (#4402) 2018-04-28 07:22:59 -07:00
Carl Mastrangelo f4f4302b85
services: remove monitoring file 2018-04-27 21:34:43 -07:00
zpencer acfb3b9851
services,core: simplify CallId generation (#4365)
BinaryLog.java is the class that is responsible for intercepting
client and server calls. It now requires a CallId to be passed
in. The BinaryLogProviderImpl is responsible for generating a
CallId and passing it in.
2018-04-27 18:32:36 -07:00
zpencer 9ada30b25d
(low priority) core,netty,interop-testing: stabilize maxInboundMessageSize API (#4399)
On server side, `maxMessageSize` is deprecated for
`maxInboundMessageSize` to match the channel builder.

Update usages to use new setter.
2018-04-27 16:01:16 -07:00
zpencer 1d80febbc0
buildscripts: make unix.sh and make_dependencies.sh arch aware (#4384)
ARCH can be '32' or '64'. If it is not set then default to '64'.

make_dependencies.sh should do the symlinking
2018-04-27 15:59:16 -07:00
Carl Mastrangelo 6046831e58
alts: make imported files have imports below package, and set licence 2018-04-26 14:48:11 -07:00
David Ostrovsky 23fcedfb6f Bazel: Fix compilation in Java 9
Fixes: #3633.

Test Plan:

On most recent Bazel version run:

  $ bazel --host_javabase=/usr/lib64/jvm/java-9-openjdk \
    build --javacopt='--release 9' \
    --java_toolchain=@bazel_tools//tools/jdk:toolchain_jdk9 \
    examples:helloworld_java_grpc
2018-04-26 14:37:57 -07:00
zpencer 44c79fbe5d
services: fix channelz linter warnings (#4395)
- final classes should have toString()
- fix arg name mismatch
2018-04-25 17:55:42 -07:00
Carl Mastrangelo 2027f6f81c
services: update to remote channelz.proto def 2018-04-25 17:05:58 -07:00
zpencer c6c20e9491
buildscripts: add linux job that release_artifacts can dep on (#4392)
* buildscripts: add linux job that release_artifacts can dep on

* rename linux -> linux_artifacts

* fix script name
2018-04-25 15:54:15 -07:00
Carl Mastrangelo 720d4fab69
all: print out diff of methods in android APK 2018-04-25 15:53:56 -07:00
Eric Gribkoff ef2a085acd
android-interop-testing: re-add min sdk version (#4393) 2018-04-25 14:48:35 -07:00
zpencer 1a2d076aed
core,netty,okhttp,services,testing: expose security info to channelz (#4300)
Pull the TLS info from the SSLSession object for TLS, and AltsContext for ALTS.
2018-04-25 14:38:09 -07:00
zpencer 218e944e16
buildscripts: initial kokoro config for auto releasing artifacts (#4391)
The script does nothing at the moment other than set up the kokoro
job.
2018-04-25 14:12:06 -07:00
zpencer 7cd2f5c3c0
buildscripts: sonatype uploader ussing CONF before it is set (#4388)
Set $CONF before we use it.
Also enable some defensive bash flags to catch errors.
Default value for USER and PASS
2018-04-25 12:54:49 -07:00
Carl Mastrangelo 6bdf5de342
alts: move alts protos to match proto package 2018-04-25 12:01:22 -07:00
Eric Gribkoff 3beb73eb46
android-interop-testing: update app dependencies (#4313) 2018-04-24 14:33:06 -07:00
zpencer 62e6e2de78
Start 1.13.0 development cycle (#4383) 2018-04-23 15:24:24 -07:00
Eric Gribkoff ba86a86c77
android: add AndroidChannelBuilder (#4172) 2018-04-23 11:49:36 -07:00
Eric Anderson a47266ea4a kokoro: Avoid --include-build for Android
Since 4369e8cd the --include-build just opens us up to trouble with
accidentally building the protoc plugin. Since we're going to do a
./gradlew install anyway, let's just wait until after that point for
building cronet.

This sort of problem was experienced while developing #4369.
2018-04-21 00:03:44 -07:00
Carl Mastrangelo 9f6270848b
benchmarks: remove unused proto import 2018-04-20 17:40:32 -07:00
zpencer 48b7c62b43
buildscripts: always keep mvn artifacts (#4372)
After searching for "artifacts retention policy" in the
kokoro-users group, I learned that there's a default 90 day
retention policy already in place.
2018-04-20 15:19:48 -07:00
Carl Mastrangelo c37ea15830
core: also expose parser on JsonParser 2018-04-20 13:25:21 -07:00
ZHANG Dapeng 74532acce0
core: use List instead of Set for drainedSubstreams
This improves latency performance (retry enabled) for NETTY transport by about 2us. For INPROCESS, NETTY_LOCAL, OKHTTP transports, the improvement seems much less than 2us.

```
before
Benchmark                                               (direct)  (transport)    Mode     Cnt         Score     Error  Units
TransportBenchmark.unaryCall1024                            true        NETTY  sample  260801     76566.536 ± 189.439  ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.00        true        NETTY  sample             60480.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.50        true        NETTY  sample             75264.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.90        true        NETTY  sample             85504.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.95        true        NETTY  sample             87424.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.99        true        NETTY  sample            100864.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.999       true        NETTY  sample            140800.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.9999      true        NETTY  sample            205547.469            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p1.00        true        NETTY  sample           3915776.000            ns/op 
TransportBenchmark.unaryCall1024                           false        NETTY  sample  208352     95865.619 ± 113.142  ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.00       false        NETTY  sample             72576.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.50       false        NETTY  sample             93568.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.90       false        NETTY  sample            105728.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.95       false        NETTY  sample            109568.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.99       false        NETTY  sample            124544.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.999      false        NETTY  sample            161792.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.9999     false        NETTY  sample            230520.448            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p1.00       false        NETTY  sample           3997696.000            ns/op
```

```
after
Benchmark                                               (direct)  (transport)    Mode     Cnt         Score     Error  Units
TransportBenchmark.unaryCall1024                            true        NETTY  sample  269471     74104.666 ± 182.514  ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.00        true        NETTY  sample             60992.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.50        true        NETTY  sample             70912.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.90        true        NETTY  sample             83584.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.95        true        NETTY  sample             85888.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.99        true        NETTY  sample            100224.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.999       true        NETTY  sample            142848.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.9999      true        NETTY  sample            489527.706            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p1.00        true        NETTY  sample           4300800.000            ns/op
TransportBenchmark.unaryCall1024                           false        NETTY  sample  216000     92468.337 ±  90.229  ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.00       false        NETTY  sample             68480.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.50       false        NETTY  sample             89472.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.90       false        NETTY  sample            103680.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.95       false        NETTY  sample            107008.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.99       false        NETTY  sample            120960.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.999      false        NETTY  sample            159232.000            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p0.9999     false        NETTY  sample            272076.493            ns/op
TransportBenchmark.unaryCall1024:unaryCall1024·p1.00       false        NETTY  sample           2662400.000            ns/op
```
2018-04-20 11:22:32 -07:00
Carl Mastrangelo c8aa9f70ca
services: move channelz proto into normalized directory structure 2018-04-20 10:53:45 -07:00
zpencer f5e8ec18b7
services: avoid static initialization for BinaryLog.java (#4363)
The code that uses this will create an instance.
2018-04-19 17:51:49 -07:00
Eric Anderson ddf77f59cc core: Fix experimental API issue for channel state API
The earlier issue was for the feature itself, not the stabilization.
2018-04-19 17:38:20 -07:00
zpencer 934c2e2fd7
core: clarify binlog API (#4362)
The interceptors are a part of the implementation and not meant for
callers.

Both methods for wrapping clients / servers can be `final`.
2018-04-19 17:32:45 -07:00
zpencer ec95999124
core: remove unneeded binlog tests for ManagedChannelImpl ServerImpl (#4361)
Replace the tests with tests that just make sure binary log is
installed. Better tests exist today in BinaryLogProviderTest to make
sure the actual logic is correct.
2018-04-19 16:55:32 -07:00
ZHANG Dapeng e67a61fa08
core: refactor ManagedChannelImplTest with a configurable builder
In previous code of `ManagedChannelImplTest`, new tests will have to add more and more custom args in `createChannel(...)`, and each time when a custom arg is needed all other default args need be repeatedly provided in `createChannel(...)`. In most cases those args are just builder attributes. So this PR makes ManagedChannelImplTest easier to stub by providing a builder field, then new tests will just set necessary builder attributes before calling `createChannel()`.
2018-04-19 10:06:39 -07:00
ZHANG Dapeng f6a032d6b2
core: forward toString for forwarding classes
Forward `toString()` method for forwarding classes to improve debug information.

For example, `ForwardingManagedChannel.toString()` will return something like:

```
ForwardingManagedChannel{delegate=ManagedChannelImpl{logId=tag-13247, target=localhost:8080}}
```
2018-04-19 10:05:48 -07:00
Carl Mastrangelo f754bff906
core: make JsonParser public 2018-04-18 18:49:08 -07:00
zpencer 30400e0e58
core: add sockets to subchannel stat (#4345)
This is info not being reported at the moment and is missing from the
display.
2018-04-16 11:33:28 -07:00
zpencer c04278ea07
services: turn channelz null futures into Status.UNIMPLEMENTED (#4346)
Then channelz GUI will take this into account. This is particularly
useful for InProcessTransport, where I have decided we do not need
special support for in channelz. The server and channel stats are
already sufficient.
2018-04-16 09:54:35 -07:00
zpencer 791a29f63b
services: socket options were erroneously ignored if socket has no stats (#4336)
This fixes listen sockets. It is ok to have no data but report socket
options.
2018-04-13 14:59:35 -07:00
Carl Mastrangelo e4502aca5d
stub: add docs clarifying readiness 2018-04-13 14:12:54 -07:00
zpencer 1d5ed78c8f
services: make channelz constructor static (#4334)
Right now this is inaccessible to services.
2018-04-13 14:10:50 -07:00
zpencer c50a57cd52
netty: fix visibility issues with InternalNettySocketSupport (#4335)
Previous version is not actually extendable from other packages.
2018-04-13 14:10:28 -07:00
Carl Mastrangelo 03465a7f45
core: don't warn on absent service config
Fixes #4333
2018-04-13 11:13:57 -07:00
ZHANG Dapeng a6811d5bb1
all: add toString() to Server to improve debug info 2018-04-13 09:41:09 -07:00