Commit Graph

2084 Commits

Author SHA1 Message Date
Carl Mastrangelo b6449a14dd benchmarks: add initial context benchmarks 2017-07-13 15:42:27 -07:00
Carl Mastrangelo d387bfe72f stub: Use named classes rather than anonymous in ServerCalls
This has a number of small benefits.  First, it makes stack traces
easier to read.  For example:

Old class names:
```
ServerCalls$1$1.class
ServerCalls$1.class
ServerCalls$2$1.class
ServerCalls$2.class
```

New class names:
```
ServerCalls$StreamingServerCallHandler.class
ServerCalls$StreamingServerCallHandler$StreamingServerCallListener.class
ServerCalls$UnaryServerCallHandler.class
ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.class
```

This is much easier to read quickly, espcially if line numbers don't
match between HEAD and the code that prints the stack trace.

Another benefit of this is that it drops a class file from the jar
(`EmptyServerCallListener`).

Lastly, it makes it easier in the future to test, since the specific
class can be referenced from a test.  Traditionally this class
hasn't been easy to test.
2017-07-13 14:33:25 -07:00
zpencer 26caa488a5 core: update javadocs regarding ClientCall mocks (#3140)
Change the @DoNotMock message to refer to InProcessServerBuilder, and include some usage examples that users may find useful.

fixes #3124
2017-07-13 08:19:29 -07:00
ZHANG Dapeng 29befc131d doc: update external link 2017-07-12 16:31:55 -07:00
Mehrdad Afshari 68d73fa4d6 doc: Uppercase Java 2017-07-12 14:35:56 -07:00
Carl Mastrangelo 0b50095aa6 all: update to gradle 4.0.1
There is a deadlock in 4.0.0 with running tests in parallel
2017-07-12 10:07:14 -07:00
Bogdan Drutu 482b651605 core: Change gRPC to use io.opencensus:opencensus-api:0.5.1. (#3204) 2017-07-11 10:13:23 -07:00
Matt Kwong 5cf469ae0b all: make Kokoro show actual Gradle results (#3208) 2017-07-10 17:26:33 -07:00
ZHANG Dapeng ff0ad5fac3 testing: refactor part of TestUtils to internal
Moved the following APIs from `io.grpc.testing.TestUtils` to `io.grpc.internal.TestUtils`:

`InetSocketAddress testServerAddress(String host, int port)`
`InetSocketAddress testServerAddress(int port)`
`List<String> preferredTestCiphers()`
`File loadCert(String name)`
`X509Certificate loadX509Cert(String fileName)`
`SSLSocketFactory newSslSocketFactoryForCa(Provider provider, File certChainFile)`
`void sleepAtLeast(long millis)`

APIs not to be moved:

`ServerInterceptor recordRequestHeadersInterceptor()`
`ServerInterceptor recordServerCallInterceptor()`
2017-07-10 16:30:38 -07:00
Mehrdad Afshari 8ce0bc25b6 Canonicalize URL prefixes to https://grpc.io 2017-07-10 16:30:09 -07:00
Carl Mastrangelo 7207a9f408 all: update to netty 4.1.13 2017-07-10 15:02:03 -07:00
Eric Anderson e6d0062d20 Move checkstyle config to buildscripts/
Checkstyle configuration is just noise in the root directory. Neither
users nor developers need to look at it often.
2017-07-07 17:11:40 -07:00
Eric Anderson ae66c72da3 releasing: Fix malformed Markdown for some links 2017-07-07 17:11:16 -07:00
Eric Anderson 1331abb326 releasing: Move CI config to just after branch creation 2017-07-07 17:11:16 -07:00
Eric Anderson 4b9c83f978 releasing: Use periodic builds for release branches 2017-07-07 17:11:16 -07:00
Carl Mastrangelo 99a60233f8 benchmarks: update to jmh 1.19 2017-07-07 11:22:27 -07:00
Carl Mastrangelo 3a5f115dbc core: clarify security methods on channel and server 2017-07-07 10:56:54 -07:00
Eric Anderson cbad906c0e Update to Error Prone 2.0.21 2017-07-07 10:30:14 -07:00
ZHANG Dapeng 0a36c9d8a3 all: migrate .proto files from testing-proto to interop-testing
and provide a simple protobuf service for test in testing-proto instead.
2017-07-06 15:26:08 -07:00
Kun Zhang 2f6e2c87ab context: stop using logger at all in static initialization. (#3191)
Turns out avoiding log() alone in the static initialization is not
enough. isLoggable() can also be overridden and call back to Context.
We take a another approach, save the exception and log it outside of
the initialization block.
2017-07-06 13:55:44 -07:00
Eric Gribkoff 7c60510794 all,interop-testing: update google-auth-library-oauth2-http (#3188) 2017-07-06 13:22:43 -07:00
Carl Mastrangelo 4bce872718 netty: remove unneeded licence file 2017-07-06 13:11:22 -07:00
Eric Anderson c637b42b71 core: Stop using context ClassLoader in Providers
currentThread().getContextClassLoader() was originally used to match
ServiceLoader's default. ServiceLoader is mostly used with SPIs that
exist in the bootclasspath and so the class's ClassLoader would not
work. But in gRPC we have a library in the application's ClassLoader.

Context ClassLoader has been causing problems in any case more than one
application ClassLoader exists, like in Servlet containers, Android, and
plugins. To my knowledge, in every case the context class loader is
different from the provider's class loader, the context class loader has
caused breakage, not success. In addition, since we use static fields
for storing the provider results, using anything but the provider's
class loader is asking to have results that vary simply depending on
which thread called gRPC first.

Fixes #2375
2017-07-06 11:02:31 -07:00
Carl Mastrangelo 424eeea8f5 all: begin 1.6 release cycle 2017-07-06 10:43:56 -07:00
Carl Mastrangelo cc5343a530 all: update to gradle 4.0 2017-07-05 18:32:35 -07:00
ZHANG Dapeng c2791496ca fix misuse of bazel repo @com_google_protobuf
resolves #3175
2017-07-05 16:15:33 -07:00
ZHANG Dapeng 69e278aa8e protobuf: configureProtoCompilation() not needed anymore 2017-07-05 15:52:18 -07:00
ZHANG Dapeng b23f35d3e5 protobuf-lite: restrict visibility of protobuf_lite 2017-07-05 14:22:32 -07:00
Eric Anderson 7384ea9da1 core: Simplify ServerImpl constructor; testable Builder 2017-07-04 20:20:04 -07:00
Eric Anderson 361f0381be interop-testing: Support conscrypt at runtime with OkHttp
Conscrypt can thus be an alternative to Jetty ALPN for running these
OkHttp integration tests.
2017-06-30 17:07:38 -07:00
Eric Anderson 9052d4245f interop-testing: Skip Netty Jetty ALPN tests if it is unavailable 2017-06-30 16:25:31 -07:00
Eric Anderson c436561fc5 all: Use fixed version number for java 6/7 signatures
This is important for stable builds, as if the signature changes the old source
may no longer validate.
2017-06-30 15:25:34 -07:00
Matt Kwong 16285dc634 Make Kokoro logs less noisy (#3110) 2017-06-30 13:53:52 -07:00
Eric Anderson 6d8a66f3e3 core: Mark InternalNotifyOnServerBuilder @Internal
It is misnamed if it is @ExperimentalApi. Even being @Internal is
strange, since nothing in io.grpc actually uses it and so it could
actually be in io.grpc.internal.

I'm not trying to fix the API, but just make it slightly more
consistent.
2017-06-29 21:46:20 -07:00
Eric Anderson a3ac64a883 core: Move client-side decompressor selection to stream
Previously ClientCallImpl's stream listener would call
stream.setDecompressor(), but this has always been a bit strange as the
only case where the call listener calls the stream and forms a bit of a
loop. It also turned out to be racy in the presence of
DelayedClientStream since DelayedClientStream does not guarantee that
the listener has processed before returning.

Now we let the stream handle decompressor selection itself. Compressor
selection on client and server and decompressor selection on server
remain unchanged. Nothing prevents them from being changed, other than
it is currently unnecessary to fix the severe compressionTest flake.

Fixes #2865
Fixes #2157
2017-06-29 18:12:53 -07:00
ZHANG Dapeng 4e31ccba4c examples: use the official error_details.proto
The `error_details.proto` file in `examples/src/main/proto/` was not originated from grpc-java. 
It was officially opensourced at https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto
2017-06-29 16:05:33 -07:00
Eric Anderson fe0f67337d examples: Enable maven enforcer requireUpperBoundDeps
Everyone using maven should really use the rule, in order to prevent
accidentally using an older version of a common library, like protobuf.
2017-06-29 15:29:30 -07:00
ZHANG Dapeng 4edb352dd4 bazel: update netty tcnative to 2.0.5
Although this repo is not used in bazel build internally, it is exposed in a bzl rule.
2017-06-29 13:35:46 -07:00
ZHANG Dapeng 36f7b34b6e examples: add bazel build example
## Bazel

If you prefer to use Bazel:
```
(With Bazel v0.4.5 or above.)
$ bazel build :hello-world-server :hello-world-client
$ # Run the server:
$ bazel-bin/hello-world-server
$ # In another terminal run the client
$ bazel-bin/hello-world-client
```
2017-06-29 12:25:54 -07:00
Eric Anderson 8f75f8ee7c all: Don't depend directly on grpc-protobuf-lite
grpc-protobuf-lite brings in protobuf-lite as a dependency, which has
different versions of classes in protobuf. This causes duplicate classes
on the class path, which easily breaks things. Since lite the lite
runtime/codegen is incompatible with full protobuf, it makes sense to
only depend on one of the two.

grpc-protobuf actually already has a dependency on grpc-protobuf-lite,
but excludes the protobuf-lite dependency, making the dep safe. But this
is more of an implementation detail.

We only change deps so that JavaDoc, code coverage, and similar will
still include grpc-protobuf-lite.

Fixes #2985
2017-06-29 10:29:11 -07:00
Carl Mastrangelo 45085c3ce4 core: minor cleanup of 859d211b6e 2017-06-28 12:36:33 -07:00
zpencer f559cf4adf netty: client transport needs to flush fence operation (#3137)
This the cause of the flakey serverNotListening test, because the
NOOP_MESSAGE just sits around the pipeline. As a result, the
listener does not fire within the 1s verification timeout.
2017-06-28 10:23:48 -07:00
Kun Zhang 4b94237bb9 core: stop spying ServerCall in UtilServerInterceptorsTest. (#3146)
Per our internal checker, DoNotMock applies to spy() too.
2017-06-27 17:15:43 -07:00
Kun Zhang 47e90f7823 netty: fix NettyHandlerSettings synchronized on wrong object. (#3144)
Bug introduced in commit 8c017337eb
2017-06-27 16:20:53 -07:00
Kun Zhang 8c017337eb netty: InternalHandlerSettings should not be used by non-Internal classes. (#3143)
InternalHandlerSettings is part of "netty:internal" inside google,
which is used to allow controlled exposure of internals.
"netty:internal" depends on "netty", which consists of the rest of the
netty subproject.  Therefore, "netty" should not depend on
"netty:internal".
2017-06-27 14:22:01 -07:00
Eric Anderson 2109700e9e gitignore Bazel build result symlinks 2017-06-27 11:10:53 -07:00
Eric Anderson 418c8846d0 core: Fix Bazel building for :util
It is now using io.grpc.internal.SerializingExecutor.
2017-06-27 11:10:34 -07:00
Carl Mastrangelo e7fd6fc55e netty: upgrade to netty tcnative 2.0.5 2017-06-26 18:29:14 -07:00
zpencer 0fa2225623 netty: fix race condition for listeners attaching to connect future (#3122)
Sadly, the serverNotListening test is still flakey after this change, but this PR fixes a legit problem.

The listener to the connect future depends on the channel pipeline being intact. But the way it is attached allows the connect attempt to fail, and have the entire pipeline being torn down by netty before the .addListener actually runs. The result is that the listener will be attached to an already completed future, and the logic will be applied to an empty pipeline.

The fundamental problem is that there are two threads, the grpc thread, and the netty thread. This PR moves the listener attaching code into the netty thread, guaranteeing the listener is attached before any connection is made. It makes more sense for the code to live inside AbstractBufferingHandler, since handlers are generally free to swallow exceptions (the alternative is to make NettyClientHandler forward exceptions up the pipeline from itself). AbstractBufferingHandler needs the special guarantees, so it will be the one with special code.
2017-06-22 22:07:51 -07:00
ZHANG Dapeng b7e50ddd05 testing: move NoopClientCall & NoopServerCall to internal
one step for #3105
2017-06-22 15:10:58 -07:00