Commit Graph

489 Commits

Author SHA1 Message Date
Kun Zhang 568d25dae9 Delete the generated files only before generateProto.
Previously generated files were deleted at configuration time. Running
non-build tasks such as ``clean`` or ``tasks`` would delete the
generated files and tracked by git, which is annoying. Now we delete
them only before the ``generateProto`` task, which solves the problem.

After this change, the case that ``generateProto`` is not executed at
all, is no longer covered. However, it is much less likely than the
still-covered case that ``generateProto`` is not re-generating all files
due to misconfiguration.
2015-05-15 10:37:57 -07:00
Louis Ryan 2a58bf8c34 Add more JUnit annotations to list of methods checkstyle will ignore 2015-05-15 09:29:46 -07:00
Louis Ryan d54911713a Implement writes to the channel using a dedicated write queue which allows for efficient flush
coalescing
2015-05-15 09:20:13 -07:00
nmittler c4c6c145af Fixing benchmarks build on non-linux systems. 2015-05-14 16:43:17 -07:00
nmittler 8f537e3ec6 updates to test native epoll 2015-05-14 15:33:55 -07:00
Xudong Ma c3125bebdb okhttp: send reset when client receives halfClose from server before sending halfClose.
So that the server side stream can be fully closed.

This fixed #300
2015-05-14 12:05:51 -07:00
nmittler 5efbb6fe73 Allow 100 streams initially rather than 10.
The HTTP/2 spec suggests 100 as the recommended minimum for SETTINGS_MAX_CONCURRENT_STREAMS (https://tools.ietf.org/html/draft-ietf-httpbis-http2-17#section-6.5.2).  We should use this value as our default.
2015-05-13 14:22:46 -07:00
Kun Zhang 8bc992091c Add Dockerfile for codegen distribution 2015-05-13 07:58:41 -07:00
Kun Zhang 9805e27569 Add property ``protoc=/path/to/protoc``
This allows people who cannot run the pre-compiled ``protoc`` pulled
from Maven Central to use their own ``protoc``.

Upgrade to protobuf-gradle-plugin:0.4.1 to display error messages of
protoc failures.
2015-05-12 17:34:40 -07:00
Eric Anderson 1787106cc7 isReady() should return false until stream allocated
isReady() can provide pushback while the call is in progress, but it
can also provide the pushback necessary when the client creates more
streams than permitted by MAX_CONCURRENT_STREAMS.

As part of this commit, OkHttp is now calling onReady() after call
creation (it previously never called onReady()).
2015-05-12 16:41:50 -07:00
nmittler c3fa600eae Fixing compiler warning. 2015-05-12 16:23:39 -07:00
nmittler d5727c7fcd Deferring stream creation until receiving SETTINGS from server.
Additionally:
- Fixed bug where the decoder was given the incorrect encoder.
- Adding proper logging class for client/server.
2015-05-12 15:46:32 -07:00
Kun Zhang 2cdc5e3c47 Fix a bug that checked-in generated code are not re-compiled.
Since commit 287a27a the ``grpc`` codegen plugin must be explicitly
added to the ``plugins`` block of the source set, while it didn't.

Remove the generated code before recompiling it to prevent such issue
from being missed by tests.
2015-05-12 13:55:37 -07:00
nmittler 518b7dbf7c Slight performance improvment for MutableHandlerRegistryImpl 2015-05-12 09:56:45 -07:00
Kun Zhang 287a27a930 Upgrade to protobuf-gradle-plugin:0.4.0
Use the plugin to compile nano for golden test and get rid of the shell
script.
2015-05-11 16:38:22 -07:00
Xudong Ma 7ecb6fa431 okhttp: Catch Exceptions thrown by the frist platform.getSelectedProtocol(sslSocket), since in some implementations, querying selected protocol before the handshake will fail with exception. 2015-05-11 13:09:15 -07:00
Mark Kelly 589afefa59 changed the netty-codec-http2 depdendency to released version
* 4.1.0.Beta5
* available on maven central http://search.maven.org/#artifactdetails%7Cio.netty%7Cnetty-codec-http2%7C4.1.0.Beta5%7Cjar
* git tag release 4.1.0.Beta5
2015-05-09 09:38:25 -07:00
Eric Anderson 3462eb0e72 Handle OkHttp throwing exception during start()
Ideally OKHttp wouldn't do blocking I/O during start(), but it does and
fixing it is non-trivial. OkHttp can either throw an exception when it
encounters an error during start or it can shut itself down. Both
require changes in ChannelImpl, so we just choose to keep OkHttp's
current behavior and deal with it in ChannelImpl.
2015-05-07 18:52:21 -07:00
Eric Anderson 4e82a11311 Make Channel/Server abstract classes
Abstract classes allow us greater ability to change them over time. They
previously were interfaces to allow us to use Guava's AbstractService.
2015-05-07 16:41:52 -07:00
Kun Zhang 6b1e7d6931 Recompile proto files if codegen has changed.
Resolves #404

Add the gRPC codegen executable and the root ``build.gradle`` (where the
protoc version is) to the inputs of ``generateProto`` task, so that the
task is rerun when either of them has changed.
2015-05-07 16:23:00 -07:00
Eric Anderson 66c55ee2b6 Make protobuf section of README easily ignorable 2015-05-07 15:52:29 -07:00
Eric Anderson 8c9cc91844 Update generated proto output
The previous output was not generated with proto3-alpha-2. This has been
regenerated using protoc on Maven Central, so it should be the same
output everywhere.
2015-05-07 15:09:26 -07:00
Kun Zhang 2f7497133d Unify build properties.
- Switch all system properties to project properties.
- Use the ``javaLocalNamingStyle`` instead of the
  ``dot.delimited.style`` for property names, so that it can be directly
  referenced by ``rootProject.propertyName``.
- Recommend users to put GRPC-specific properties in project-level
  ``build.properties`` instead of the user-level.
2015-05-07 14:14:10 -07:00
Kun Zhang c5b94c7525 Use protoc from Maven Central. 2015-05-07 11:18:43 -07:00
Eric Anderson 86207752b7 Stop running gradle in run-test-{client,server}.sh
This substantially decreases the amount of time to run a client test via
the script.
2015-05-07 10:53:20 -07:00
nmittler 1fa11cea1f Adding default implementation of onReady in Call and ServerCall 2015-05-07 10:52:07 -07:00
Eric Anderson 1cf4cc81e8 Use CreateStartScripts for examples
This makes it easy to run our test client/server without the "magic" of
executing directly from Gradle. This makes it more obvious what code is
being run and prevents confusion due to Gradle "hanging" when starting
the server.

This also fixes build errors when running 'installDist' at the root
project.
2015-05-07 08:42:34 -07:00
nmittler b6407c4a10 Only complete graceful shutdown after buffered streams complete.
Upgrading to to the latest Netty as well.
2015-05-07 08:36:22 -07:00
nmittler b5443833d9 Fixing build issue. 2015-05-07 07:50:33 -07:00
Eric Anderson f78813e013 Document how to use IntelliJ style
Thanks to justinb.
2015-05-07 07:38:52 -07:00
Eric Anderson 4285d826d3 Fix "mispelled" reference to gradlew 2015-05-07 07:38:51 -07:00
Kun Zhang d32bb477b9 Add build status icon and rephrase title 2015-05-06 16:15:53 -07:00
nmittler d8d8ebd783 Adding logging to NettyClientHandler. 2015-05-06 14:38:22 -07:00
nmittler 64df428e36 Properly removing buffered streams after receiving goAway 2015-05-06 14:24:29 -07:00
Kun Zhang 693a7d2846 Fix the filesets to be checked by checkstyle. 2015-05-06 11:35:08 -07:00
Kun Zhang 111f6dd81e Allow people to skip codegen compilation.
Resolves #357

- Add project property ``grpc.skip.codegen``, which is false by default.
  People who don't change the codegen nor the proto files can set it to
  true so that they don't need to set up C++ compilation.
- Check in all generated files under ``src/generated``.
2015-05-06 09:56:40 -07:00
nmittler 7f73189e56 Always checking MAX_CONCURRENT_STREAMS in
BufferingHttp2ConnectionEncoder.

Currently we don't check this setting when handling a streamClosed()
event. If the setting has lowered prior to this event, the stream
creation could fail.
2015-05-05 19:29:34 -07:00
nmittler a45e0a4767 Cleaning up closing for Netty client/server. 2015-05-05 15:43:22 -07:00
nmittler ef6a2f02d4 Updating to the latest Netty version.
Also re-enabling the gracefulShutdown test now that Netty has been
fixed.
2015-05-05 15:39:21 -07:00
Eric Anderson 041cdb11ed Add Jacoco code coverage
After running tests, you can run jacocoTestReport. The jacocoTestReport
task does not depend on the tests, so they should be run separately.

There is still a lot of noise in the jacoco output since we aren't yet
filtering generated code.
2015-05-05 14:36:00 -07:00
nmittler cde7eaa585 Updating to the latest Netty version. 2015-05-05 11:40:22 -07:00
Eric Anderson 10fb20650d Produce combined JavaDoc, add links, exclude internals 2015-05-05 11:32:15 -07:00
Eric Anderson 00a7192f73 Use CreateStartScripts for integration-testing
This makes it easy to run our test client/server without running gradle
every time. For the moment we run 'installDist' in our script since that
is not performed as part of 'build' or 'assemble'. Once we fix our
scripts and improve the documentation, we can remove running installdist
from our script.
2015-05-05 11:11:49 -07:00
Eric Anderson ad44f0aa62 Make checkstyle fail build by default
It seems almost every developer has caused Travis CI to break due to
checkstyle failures. To prevent further breakages, checkstyle will now
fail the build by default.

Specifying checkstyle.ignoreFailures=true in ~/.gradle/gradle.properties
will turn the failures into warnings, which was the old behavior.
2015-05-05 11:09:45 -07:00
nmittler 80a9dceb19 Adding bin to .gitignore for OSX 2015-05-05 10:15:27 -07:00
Eric Anderson 35cb22dd42 Add comment to satisfy checkstyle 2015-05-05 08:47:00 -07:00
Eric Anderson c8c478ef81 netty: Remove goAwayStatus when client closing
Client closing doesn't really many anything special, since it is still
fully-operational. We don't want a later goAwayStatus() from getting
squelched because we were shutting down.
2015-05-05 08:38:38 -07:00
nmittler 68cba971af Do not fail pending streams when sending GOAWAY.
If the HEADERS have been written to the buffering encoder we should
allow their creation to complete since the HTTP/2 spec does not prohibit
this.
2015-05-04 13:00:11 -07:00
nmittler 64176d5560 Adding outbound flow control for Netty. 2015-05-04 12:19:57 -07:00
Jakob Buchgraber 1af367c786 Remove all blocking from the NettyClientTransport. Fixes #116
Motivation:

We are currently blocking in NettyClientTransport.newStream(...) until the channel is active and/or the TLS Handshake is complete.
In certain cases this may lead to deadlock of the eventloop, see #116 for details.

Modifications:

Remove all blocking by buffering writes until the channel is ready to receive those i.e. it is active, TLS is negotiated or the HTTP to HTTP/2 upgrade was sucessfull.

Result:

No more blocking parts when using Netty on the client side.
2015-05-04 11:50:53 -07:00