Commit Graph

6498 Commits

Author SHA1 Message Date
Kun Zhang 3ddd1d525f Log stack traces of test failures to the console.
By default we have to open a HTML page in a browser to see the details,
which is not possible if the test was run in Travis.
2015-04-22 14:49:43 -07:00
nmittler 3ecbd0456a Upgrading to latest Netty version.
This is to resolve the issue of receiving frames for closed (and
therefore missing) streams.
2015-04-22 10:46:07 -07:00
Eric Anderson fc3e41674b Propagate explicit flushes through MessageFramer
MessageFramer allows queing of data and explicit flushing. Sinks
generally can benefit from knowing when they are required to flush, so
we now tell them when MessageFramer received a flush so they only have
to flush when required.
2015-04-21 10:29:08 -07:00
Kun Zhang af18876713 Upgrade to com.google.protobuf:protobuf-gradle-plugin:0.1.0
Commit 76f0a09 after the previous release
(ws.antonov.gradle.plugins:gradle-plugin-protobuf:0.9.1) defers the
generation of generateProto tasks to post-evaluation of the project,
which make them no longer available in the evaluation phase. We need to
move the manipulation of these tasks to post-evaluation too.
2015-04-20 10:35:11 -07:00
Nobutaka Takushima a287a113e5 fix android app build broken by 3666de4427
In grpc-java, io.grpc.nano was renamed to io.grpc.protobuf.nano.
Therefore, android app fails to build with the latest version of grpc-java.
2015-04-20 12:13:19 +09:00
Nobutaka Takushima 9528a275ac Fix protobuf-nano build broken by 3666de4427 2015-04-20 11:43:06 +09:00
Kun Zhang 4bc2d6d9a4 Remove call sites of Os.isFamily(). Use osdetector instead 2015-04-17 16:35:23 -07:00
Kun Zhang 0c2ea1550b Fix Mac build failure introduced by commit da3c3f8
- Add -lprotobuf etc to linker.args if libprotobuf.a etc doesn't exist in
  LDFLAGS
- install does not do architecture and dependency check on the artifacts,
  because it may produce non-publishable artifacts due to the above
  change.
2015-04-17 16:32:13 -07:00
zhangkun83 da3c3f8ced Solution for GRPC codegen deployment. 2015-04-16 15:07:36 -07:00
Eric Anderson 23aac9e9ec Fix netty closure check
During Service removal a condition was inverted but incompletely, which
caused the Netty server to never shutdown.
2015-04-16 12:29:24 -07:00
Eric Anderson 4f4f8e40bf Remove Guava's Service from server transport
ServerImpl.start() now throws IOException to make the error explicit.
This was previously being papered over by wrapping the exception in
RuntimeException.
2015-04-16 11:28:04 -07:00
nmittler f920badc5e Upgrading to the latest Netty version. 2015-04-16 08:42:56 -07:00
Xudong Ma 883eb62de4 OkHttp: Temporally support multiple h2-xx protocol on client side.
Since the user provided SSLSocketFactory (especially in Android) may already do the handshake when creates the SSLSocket, and it may choose a different protocol name other than the one OkHttp is using.

Resolves #293
2015-04-16 09:04:19 +08:00
Xudong Ma 1066222eba De-flake transport test.
See #289 for more detail.

I can't reproduce the failure locally, so my guess is that our TIMEOUT is too short for Travis, when the Travis machines get high CPU usage or short of memory (and causes full GC), we should tolerate longer waiting time.

I'm not sure whether this change can fix the flakeness, but I'd like to give it a try.
2015-04-15 09:33:36 +08:00
Eric Anderson 5b2e336b6f netty: Add option to set MAX_CONCURRENT_STREAMS 2015-04-13 13:46:36 -07:00
Eric Anderson 844d207823 Add missing projects to grpc-all
Protobuf was recently moved into its own project and should have been
added to grpc-all at that time. Nano has always been absent.
2015-04-13 08:54:01 -07:00
Eric Anderson 3666de4427 Use more precise names for protobuf and nano
io.grpc.nano sort of seems like a "small" version of grpc-java. And
io.grpc.proto could also mean multiple things. Using "protobuf"
and "protobuf nano" gets us consistent names that are still
understandable, predictable, and more similar to protobuf project
itself.
2015-04-10 16:35:23 -07:00
Eric Anderson e23f899491 Split protobuf into its own project
We don't want core to depend on protobuf.
2015-04-10 15:50:56 -07:00
Eric Anderson 1e257c440e Remove unused local variable 2015-04-10 08:58:43 -07:00
Eric Anderson d077290c40 Fix warnings (JavaDoc and [deprecated]) 2015-04-09 18:05:31 -07:00
Kun Zhang 0d89d3d1bc Fix the issue where the intecepting call fails in start(), does not
call super.start(), and makes the subsequent use of other methods on the
call throw IllegalStateException.

Create ClientInterceptors.CheckedForwardingCall that handles exception
in start logic.

Create Forwarding[Server]Call[Listener] for generic decoration use
cases, with an abstract delegate() for flexibility.

Create SimpleForwarding[Server]Call[Listener] to replace now deprecated
forwarding classes.
2015-04-09 15:56:03 -07:00
Kun Zhang 90706dc48f Rename the codegen binary from java_plugin to protoc-gen-grpc-java 2015-04-09 15:24:46 -07:00
Eric Anderson 3f19671028 Delete Java's README.md
It is documentation for examples that don't exist in grpc-common. It will only confuse people.
2015-04-09 13:47:30 -07:00
Jakob Buchgraber e8afa3ca23 Fix bug where the stream id would not get incremented for buffered streams. 2015-04-09 13:04:39 -07:00
Xudong Ma 9d214637e6 Temporally support Http protocol name "h2-16" for OkHttp client.
Fixes #22 for real.

Manually tested with jdk8 by:
./run-test-server.sh
./run-test-client.sh --server_host_override=foo.test.google.fr --use_test_ca=true --use_okhttp=true
2015-04-09 13:50:18 +08:00
Xudong Ma 775829a1b2 okhttp: Reset stream when receiving window is negative.
Resolves #215
2015-04-09 09:07:59 +08:00
Eric Anderson fd7ba566aa netty: Use the bootstrap ClassLoader for ALPN/NPN
If ALPN.class isn't in the bootclasspath, we don't want to find it as it
won't work. Also, if someone has fiddled with ClassLoaders, we really
want to make sure we get the proper ALPN class.

Passing "null" to Class.forName() means "bootstrap class loader". In
fact, ClassLoader.getParent() says, "Some implementations may use null
to represent the bootstrap class loader."

We must load the Proxy in the bootstrap class loader as well, because
our class loader may not have access to ALPN.{Client,Server}Provider,
for the same reasons as above. Even if we have multiple instances of
gRPC (due to class loaders), combined they will only create two Proxy
classes: one for ALPN.ClientProvider and one for ALPN.ServerProvider.
2015-04-08 15:37:44 -07:00
Jakob Buchgraber 44f9904ab0 Replace 'internal' import with correct one.
The errornous import was introduced by my previous commit 5f70a12cfc
2015-04-08 12:54:30 -07:00
zhaohaifeng 63db06850e Add simple HelloWord example handling custom header 2015-04-08 08:45:06 -07:00
Xudong Ma f3ccdd99f1 Fixes Travis breakage 2015-04-08 13:00:09 +08:00
Xudong Ma c2f039411a TLS support for okhttp transport.
Resolves #22

Add an API to let users specify ConnectionSpec.
2015-04-08 12:41:35 +08:00
Jakob Buchgraber 5f70a12cfc Remove blocking on client stream creation and buffer RPC Calls for when the MAX_CONCURRENT_STREAMS limit is hit. Fixes #118 2015-04-07 17:06:21 -07:00
Jakob Buchgraber ce860f9003 fix compile error introduced by previous commit 2015-04-07 13:00:24 -07:00
Jakob Buchgraber 105964bfac Fix memory leak by adding the Http2StreamRemovalPolicy to the channel pipeline.
In benchmarks we would see grpc talking up tens of gigabytes of memory. A heap dump
revealed that streams would not get cleaned up and stick around in memory forever.
2015-04-07 12:56:27 -07:00
Xudong Ma fcf1517054 Respect MAX_CONCURRENT_STREAMS in OkHttp client.
If a newStream is called  while MAX_CONCURRENT_STREAMS is reached, then get the call blocked and the request queued, until:
1. a running stream closed, and this newStream() request is accepted.
2. receives go-away from server, fail all pending new stream requests.
3. the available ids are exhausted.
2015-04-07 09:53:47 +08:00
Xudong Ma 9aae6f65fa checkstyle change:
1. Adds <property name="separateLineBetweenGroups" value="true"/> to CustomImportOrder to enfore blank line between imports groups.
2. Uses checkstyle 6.5, which fixed a bug of "CustomImportOrder checks import sorting according to ASCII order instead of case-insensitive alphabetical order".
2015-04-07 08:27:48 +08:00
Eric Anderson 45682dbc18 Hold lock while reading isThreadScheduled
isThreadScheduled is @GuardedBy("internalLock").
2015-04-06 14:13:49 -07:00
Eric Anderson d70d91b5d6 Improve JavaDoc for Status 2015-04-03 16:07:46 -07:00
Eric Anderson 74c9b5ed02 Fix JavaDoc references to non-imported class
The ServerImpl import was removed because it wasn't used as far as
checkstyle was able to determine. However, it was being used to resolve
JavaDoc references. Instead of re-adding the import just make the
reference fully qualified to prevent the two systems from continuing to
disagree on whether it is needed.
2015-04-03 15:11:51 -07:00
Xudong Ma 2cad9e6000 Add "unsed import" check. 2015-04-03 16:55:01 +08:00
Xudong Ma c813ec5ad1 Change the package option of example protos to be same as grpc-common 2015-04-02 17:12:37 +08:00
Xudong Ma eb2d65bb0c Disable Nagle's algorithm, this was exposed by our internal micro benchmark, the streamingInputCall() method happened to have the write-write-read pattern which added 40ms extra delay.
According to our micro benchmark, this change improves the performance, see https://screenshot.googleplex.com/cfxjPGxkgF.png for the previous results, there were 4 out of 6 scenarios had higher latency than netty transport.

https://screenshot.googleplex.com/Rq92tYMvBE.png shows the results after this change, the latencies in all scenarios are less than netty transport.

This commit fixes #60.
2015-04-02 13:44:47 +08:00
Eric Anderson a375eccbea Use codegen for integration testing
test.proto was taken from C++ interop in the grpc repo and slightly
modified (imports, option java_package, proto3)
2015-04-01 09:51:57 -07:00
Eric Anderson 16055787fa Cache Gradle and not really Maven
Artifacts that Gradle caches from Maven Central go in
~/.gradle/caches/modules-2, not ~/.m2. We only need .m2 for the
locally-installed Netty.
2015-04-01 09:03:06 -07:00
nmittler 11d0094e04 Upgrading to the latest Netty 4.1 branch. 2015-03-31 14:14:29 -07:00
Eric Anderson 9bd31daee6 Wait for handler registration 2015-03-26 12:35:31 -07:00
zhangkun83 966e120098 Add precondition to throw more informative exception when calling request() before start() has been called. 2015-03-26 10:54:59 -07:00
Eric Anderson 191dcd38ac Test whether inbound flow control functions
The previous flow control test would work without issue even if flow
control was being ignored.
2015-03-26 10:09:51 -07:00
Eric Anderson b48b4db3fb Fix synchronization in client auth
The synchronization was simply using the wrong object, so no
synchronization was actually occurring. In addition, reference of cached
outside of synchronized block could permit using a partially constructed
cached object, as the reference may be set before instantiation
completes.
2015-03-26 07:35:07 -07:00
Eric Anderson e515c772cd netty: Status should be based on GOAWAY code
goingAway() is called before onGoAwayRead() in Netty:
b7f57223c1/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2ConnectionDecoder.java (L521)

The test before checked that the stream went away, but not that the
GOAWAY code influenced our Status, as UNAVAILABLE is the default
internally.

The UNAVAILABLE default has also been changed to include a message so
that we can determine where the Status came from in case it is triggered
again in the future.
2015-03-25 11:04:52 -07:00