Commit Graph

29 Commits

Author SHA1 Message Date
Eric Anderson d11e9be127 Add in-process transport
Resolves #518
2015-07-22 15:54:37 -07:00
Kun Zhang eb92967a7e Get rid of AbstractServiceDescriptor as it is no longer useful 2015-07-17 17:03:36 -07:00
Kun Zhang 686dcff217 Rename unaryFutureCall to futureUnaryCall 2015-07-16 12:34:37 -07:00
Kun Zhang 690b26eb93 Sanitize ClientCalls.
- Remove blockingClientStreamingCall() which is not used, and we don't
  actually want that API.
- Rename duplexStreamingCall() to asyncDuplexStreamingCall() to align
  with other async methods.
- In unary call and client streaming call, do not request for additional
  response after the first response.
2015-07-15 17:35:36 -07:00
Kun Zhang 79f3f026f2 Migrate from PARSER to parser() as a way of getting the parser of a protobuf message.
This was done by #587 (commit af9fb6de77)
but was accidentally reverted by commit 73acc73dbf.
2015-07-15 16:55:26 -07:00
Jack Coughlin 3e26b993ce Enforce request deadline
Use a ScheduledExecutorService in the ChannelImpl to terminate the
request by closing the ClientStream with status DEADLINE_EXCEEDED
2015-07-14 16:47:45 -07:00
Eric Anderson ac9db3b157 Reduce flow control window for interop tests
Many of the interop tests were designed with the default 64 KB flow
control window in mind. If we test with 1 MB then it defeats the flow
control testing.

65 KB is an arbitrary number, but I chose it to be rather small, but
still not the HTTP/2-default 64 KB because implementations have had
trouble with applying flow control changes correctly.
2015-07-14 14:42:55 -07:00
Kun Zhang 867c76d185 Separate ServerCall binding utilities per method type.
This gives us more flexibility in API changes in the future.

Unary call and server streaming call should call the flow-control method
call.request() only once. Previously it was called whenever a request
arrives, which is wrong. Now it's fixed.

Resolves #436
2015-07-14 13:36:16 -07:00
Kun Zhang c73b75e477 Change AbstractServiceDescriptor.methods() to Collection. Resolves #573 2015-07-09 14:24:51 -07:00
Kun Zhang 73acc73dbf Remove Method and switch its users to MethodDescriptor.
Resolves #511.

- In generated code, make CONFIG private and METHOD_* fields public.
  METHOD_* fields are MethodDescriptors now, users of the CONFIG field
  should switch to using the METHOD_* fields.
- Move MethodType into MethodDescriptor (#529).
- Unify the fully qualified method name. It is fully qualified service
  name + slash + short method name. It doesn't have the leading slash.
- HandlerRegistry switches the key from short method name to fully
  qualified method name.
2015-07-09 09:29:03 -07:00
Kun Zhang 35f77ee84b Upgrade to protobuf-gradle-plugin 0.5.0 2015-07-08 16:24:59 -07:00
Kun Zhang d3c5b00827 Add CallOptions.
- Pass CallOptions to Channel.newCall() and
  ClientInterceptor.interceptCall().
- Remove timeout from AbstractStub.StubConfigBuilder and add deadline,
  which is stored in a CallOptions inside the stub.
- Deadline is in nanoseconds in the clock defined by System.nanoTime().
  It is converted to timeout before transmitting on the wire. Fail the
  call with DEADLINE_EXCEEDED if it's already expired.
2015-07-07 14:28:38 -07:00
Eric Anderson 68efade3f5 Set hard-coded deadline to just under 1 year
10 years exceeds the maximum for some systems at the moment. Change to 1
year to workaround such systems while they get changed. And since "have
the default be a large number instead of not present" is a temporary fix
anyway.
2015-07-06 12:48:26 -07:00
Eric Anderson 7233077cdf Fake infinite timeout; 1s is not a good hard-coded timeout
Stubs don't have any timeout. However, MethodDescriptor does and
requires a timeout. We really want "no timeout," which is infinite, but
we use 10 years as the next best thing. CallOptions will end up fixing
this hack as MethodDescriptor will no longer have timeout.

Before, the hard-coded 1s didn't matter, because nobody was observing
it. Since 77878a0 it is now being sent to servers, and some servers
enforce it. Oops.
2015-07-01 16:24:39 -07:00
Kun Zhang af9fb6de77 Migrate from PARSER to parser() as a way of getting the parser of a protobuf message.
Upgrade to protobuf-3.0.0-alpha-3.1 that adds parser(). PARSER will go away eventually.
2015-06-30 23:14:21 -07:00
Xudong Ma 27b36483f7 Update usage of deprecated API, and add back the blank lines removed by Intellij's reformat. 2015-06-25 14:55:29 -07:00
Xudong Ma 8f51457ee1 Rename getSslSocketFactoryForCertainCert to be newSslSocketFactoryForCa.
Fixes #560
2015-06-25 14:46:05 -07:00
Eric Anderson 4d5caf83fb Use exit() for integration test client
On my machine, the client currently takes ~3s to run a test. However,
with exit() it takes < 1s. When doing lots of integration tests, those
seconds add up.

We know one of those seconds is the DESTROY_DELAY_SECONDS of
SharedResourceHolder. Part of another second appears to be Netty
creating any threads that weren't previously created when shutting down.
2015-06-18 17:24:16 -07:00
Xudong Ma eb15eb2821 Some cleanup for okhttp:
1. Move DEFAULT_CONNECTION_SPEC to OkHttpChannelBuilder
2. make OkHttpClientTransport package-private
3. Rename OkHttpChannelBuilder.setConnectionSpec to connectionSpec
2015-06-18 13:29:18 -07:00
Jack Coughlin 77878a04ee Pass timeout header in ChannelImpl 2015-06-17 16:03:13 -07:00
Eric Anderson 424c7e64c3 Avoid GCM in unit tests
GCM is very slow, and doesn't provide any benefit in unit tests. Even if
we were using tcnative and GCM is fast, using more available ciphers in
tests still makes sense. With this change building with Java 7 works
again, although that isn't the reason for the change.

On my machine with parallel building, it cuts full build time from
92 seconds to 39 seconds. For an incremental build after only changing
an interop test, the build time is cut from 73 seconds to 15 seconds.
2015-06-16 12:36:57 -07:00
Kun Zhang a251171850 Upgrade to protobuf-3.0.0-alpha-3 2015-06-05 16:27:17 -07:00
Kun Zhang 2ee4d0228d Rename Call to ClientCalls.
Other classes are already following the convention that ClientFoo for
client-side, and ServerFoo for server-side. Call has been the black
sheep of the family.

- Call -> ClientCall
- Calls -> ClientCalls
- ForwardingCall* -> ForwardingClientCall*
2015-06-04 16:39:25 -07:00
nmittler 4ee2a6584a Allowing Netty TLS bootstrap handler to be sharable.
Fixes #504
2015-06-03 09:42:08 -07:00
Xudong Ma ac4952c45a Add service_account_creds test.
Fixes #456

Manually tested with ./run-test-client.sh --server_port=443 --server_host=grpc-test.sandbox.google.com --server_host_override=grpc-test.sandbox.google.com --service_account_key_file=/usr/local/google/home/simonma/gce_cred.json --oauth_scope=https://www.googleapis.com/auth/xapi.zoo --test_case=service_account_creds
2015-05-28 16:58:58 -07:00
Xudong Ma 926a2c168a Add compute_engine_creds test.
Fixes #455

Manually tesed by running on GCE (for both netty and okhttp):
./run-test-client.sh --server_port=443 --server_host=grpc-test.sandbox.google.com -
-server_host_override=grpc-test.sandbox.google.com --default_service_account=155450119199-r5aaqa2vqoa9g5mv2m6s3m1
l293rlmel@developer.gserviceaccount.com --oauth_scope=https://www.googleapis.com/auth/xapi.zoo --test_case=comput
e_engine_creds
2015-05-28 15:56:49 -07:00
nmittler f770ffb18f Making test certs more shareable
To use the test certs a module has to depend on the grpc-interop-testing module, which doesn't really make sense.  I'm moving the certs to the grpc-testing module, which is meant to be a sort of testing common area for all of our modules.
2015-05-28 11:34:25 -07:00
nmittler 74cfe6c495 Adding alpn_boot configuration to the parent build file.
This allows all modules access to the alpnboot jar without having to copy&paste the configuration.
2015-05-22 13:05:35 -07:00
Eric Anderson e03d5c0210 Rename integration-testing to interop-testing
"Interoperability" is a more appropriate name for the tests, since they
are used for testing across different implementations. They will do a
bit of integration testing, like for auth, but this is a smaller scale.

It seems the other languages (Go, C++, Node, PHP, Python, Ruby) are
using "interop" to describe the tests, and the test case specifications
document is named with "interop". After this change, C# will be the only
language calling them "integration" tests.

This change just renames the folder and artifact. We can change the
internal package names later. However, once we do a release, old
artifact names will live forever in Maven Central.
2015-05-20 14:57:36 -07:00