Commit Graph

76 Commits

Author SHA1 Message Date
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 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 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
Kun Zhang 221c534f11 Fix build on Windows/VC++
- Stop defining custom architectures because VisualCpp toolchain doesn't
  allow it. Reference to built-in architectures 'x86' and 'x86_64' since
  they are supported by all toolchains.
- Remove 'local_arch' from platforms. For unsupported platform, we just
  do not specify the target.
- Target no more than one platform at a time. This simplifies the build
  script a lot.
- Remove the TARGET_ARCHS environment variable. Add system property
  ``arch`` to override ``osdetector.arch``.
- Add ``vc.disable`` to override the default choice of VisualCpp on
  Windows.
- Add ``vc.`` prefix to the properties that are only used with VC++
2015-05-04 09:25:49 -07:00
Eric Anderson b6eb9d763d Don't close streams when sending GOAWAY
This reverts a change introduced in f920bad which caused all streams to
be closed when sending GOAWAY as part of graceful shutdown. This is
because lastKnownId() returns -1 when a GOAWAY has not been received.

The test doesn't pass, but at least appears to revert to the old
behavior. It is unknown if the test fails to pass due to client or
server, but given reports that the old code was working, we are thinking
that server-side GOAWAY handling is what is preventing the test from
passing.
2015-05-01 20:05:18 -07:00
Eric Anderson e05885d2aa Swap to Netty's SslContextBuilder
We provide a utility to configure the SslContext for our usage, which we
can change as necessary.
2015-05-01 08:42:12 -07:00
Kun Zhang 41940f7ff7 Upgrade to protobuf plugin 0.3.1
The plugin has been published on plugins.gradle.org

Conforming to the Gradle standard that plugin IDs must be name-spaced,
the plugin ID has been changed to com.google.protobuf.
2015-04-29 16:28:50 -07:00
Louis Ryan d8d7908109 Avoid flushing CreateStreamCommand for calls where the client is known to send a payload immediately afterward.
Added simple JMH benchmark for Netty so improvements can be measured
2015-04-29 13:41:15 -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
zhangkun83 da3c3f8ced Solution for GRPC codegen deployment. 2015-04-16 15:07:36 -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
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 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
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
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
Xudong Ma 2cad9e6000 Add "unsed import" check. 2015-04-03 16:55:01 +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 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 2cbbd4706a Split large payload into separate test with higher timeout
Also show more exception info in case the test still fails.
2015-03-23 12:06:03 -07:00
Eric Anderson d8fb6f0bad Use TLS for Netty integration tests 2015-03-23 09:25:05 -07:00
Xudong Ma 3db92977fa Add missing @RunWith. 2015-03-18 11:22:49 +08:00
Eric Anderson c3e8dae6ce Add checkstyle checking
The checkstyle.xml is a slightly modified version of the upstream Google
checkstyle configuration. All changes have comment describing them.

Lots of warnings were corrected. Examples is the only project that has
warnings still, as the necessary changes require some thought.
2015-03-16 10:53:13 -07:00
Eric Anderson 76d0955a6e Clean up warnings
-Xlint:-options is not available on some earlier JDK 7s, but won't fail
if unsupported. It prevents the warning wanting bootclasspath specified
since target/source is 1.6.
2015-03-12 17:37:32 -07:00
Louis Ryan 1216de6262 Add support to Netty builders for other channel types. Demonstrate and test use of this with local channels 2015-03-12 16:05:33 -07:00
nmittler 6c6789c0a8 Adding SimpleContext back into messages.proto. 2015-02-26 10:33:18 -08:00
nmittler 0e7685b2dd Updating integ test protos to be consistent with C
See https://github.com/grpc/grpc/tree/master/test/cpp/interop

Their protos are missing the java package options. I'll file a separate
PR to resolve this.
2015-02-26 07:43:23 -08:00
Eric Anderson ff2a28535a Swap to proto3
Benchmark remains proto2 as the .proto has defaults that will need to be
adjusted.
2015-02-25 21:50:37 -08:00
Jakob Buchgraber 62f4399e26 Add 10s timeouts to integration tests 2015-02-18 15:56:40 -08:00
Jakob Buchgraber 7ddcdfd26c Define ALPN package as an extra variable, to be reused by subprojects. 2015-02-17 10:46:17 -08:00
Jakob Buchgraber 44574944b9 Move TLS certificates.
- Move certificates to src/main/resources folder.
- Update the code that loads the certificates to make use of Java's resources API.
2015-02-13 11:37:59 -08:00
Eric Anderson e5269899b7 Have test server print info about test client 2015-01-30 14:22:24 -08:00
nmittler f83145865a Removing all references to "stubby" 2015-01-27 11:25:25 -08:00
Eric Anderson aeeebb7cdb Remove Service API from ServerImpl
Fixes #21
2015-01-27 09:20:24 -08:00
nmittler 19052499f7 Removing Maven build 2015-01-27 08:57:37 -08:00
nmittler 02c953e5e0 Migrating run scripts to gradle. 2015-01-26 15:26:11 -08:00
nmittler de3a13164f Changing gRPC Java inbound flow control model
The goal is to mirror the token-based approach used by the Reactive
Streams API.
2015-01-22 11:46:16 -08:00
nmittler 52f4220395 Adding .gitignore for eclipse files. 2015-01-21 16:14:48 -08:00
Louis Ryan 11026b69cc Fix IntelliJ dependency on generated protobufs 2015-01-20 16:24:52 -08:00
ejona 4de2026492 Fix TODO attribution
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=84172357
2015-01-16 16:23:05 -08:00
Eric Anderson 080e33effd Align server flags with other languages
There are also no longer any required arguments. The argument processing
flow was changed to match that of the client.
2015-01-16 13:13:57 -08:00
Eric Anderson 6239965030 Improve test client for real cert
The test client can now be used against a server that has properly
configured certificates, instead of just the test server. To reach the
test server, the client needs these arguments:
--use_test_ca=true --server_host_override=foo.test.google.fr

Client no longer has any required arguments, although for any given
setup needing to specify at least one argument is highly likely.

The arguments have been improved in general to hopefully be more
orthogonal and match those of other language's test clients.
2015-01-16 13:07:29 -08:00
ejona 7235a396b8 Remove Service API from ChannelImpl
This change loses asynchronous notification of channel state-change and
a way to wait until the channel is actually connected. Both of these are
expected to be added back as part of a health API. The important
distinction from Service is that ChannelImpl never permanently fails and
can revert from being started to connecting again.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=83875407
2015-01-15 13:42:49 -08:00
simonma 828f941e99 Remove dependency on guava Lists for initializing list.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=83808289
2015-01-15 13:42:43 -08:00
yangg f8524a17b8 Add package name to the method string.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=83353207
2015-01-08 14:43:24 -08:00
rocking ee86ee41a0 Nano proto and Proto3 do no include fields that have their default values in the wire format.
Avoid using hasxxxx

-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=82743695
2015-01-08 14:43:23 -08:00
ejona c0f41920bd Remove gRPC v1 support.
No major refactorings/simplifications were done. Only gRPC v1 support
infrastructure was removed.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=82737436
2015-01-08 14:43:23 -08:00
ejona 1c20eb6cef Implement cancel_after_* integration tests
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=82734780
2015-01-08 14:43:22 -08:00
ejona 42fcc501b9 Implement empty_stream integration test
The test was going to use a queue like ping_pong, but using a mock
proved much simpler. Thus, I also updated ping_pong to use the simpler
model, because it is useful for the two tests to be similar.

InProcessTransportTest failed for empty_stream due to gRPC v2 issues,
and so instead of ignoring emptyStream() I found the broken tests that
were preventing swapping to gRPC v2 and ignored them instead.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=82733943
2015-01-08 14:43:22 -08:00