Commit Graph

750 Commits

Author SHA1 Message Date
Kun Zhang b80abef13f Optimize for flow-control: only request for 2 responses in unary-response cases 2015-07-17 09:09:29 -07:00
Kun Zhang d28535bb20 Fail call if more than responses received while only one is expected 2015-07-16 18:17:07 -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
Carl Mastrangelo 0003e44886 Add simple server timeout support
Reintroduce throws

Add timeoutExecutor shutdown

Use a default future

Move timeout cancellation

Cancel the timeout in error cases
2015-07-15 09:33:16 -07:00
Xudong Ma ad7820ca9b Remove OkHttpClientTransport.DEFAULT_INITIAL_WINDOW_SIZE, use Utils.DEFAULT_WINDOW_SIZE instead. 2015-07-14 17:14:20 -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
Xudong Ma 9c27540a4f Support TLS for okhttp benchmark. 2015-07-14 11:16:37 -07:00
Ben McCann 652abe2f63 Simplify the build instructions now that Netty can be fetched from Maven 2015-07-09 15:29:11 -07:00
Kun Zhang c73b75e477 Change AbstractServiceDescriptor.methods() to Collection. Resolves #573 2015-07-09 14:24:51 -07:00
Carl Mastrangelo 3ee5b5a752 Try to simplify server method definition 2015-07-09 14:06:47 -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
nmittler a6c51e7e14 Fixing some compiler warnings. 2015-07-08 16:10:54 -07:00
nmittler 8c1d38a0d8 Adding default User-Agent for netty and okhttp. 2015-07-08 15:56:54 -07:00
nmittler efbb65522b Simplifying flow control window config for Netty.
Fixes #494
2015-07-08 15:43:03 -07:00
Eric Anderson 35ff624eb2 Metadata.Key's name is non-null; don't check for null
There is a Preconditions.checkNotNull guaranteeing name is not null.
2015-07-08 15:10:02 -07:00
Eric Anderson d27cbc8aa3 Improve docs to describe close as being last method called
This isn't changing any of the semantics we already had, but more
informing users of the guarantees we provide.
2015-07-08 15:08:26 -07:00
Kun Zhang 7fff088e19 Fix a javadoc warning 2015-07-07 16:02:47 -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
Xudong Ma 12d57974c0 Android interop test: Use proto plugin to generate the needed code. 2015-07-07 10:11:00 -07:00
Eric Anderson 30455fd2f4 Remove unused variables 2015-07-06 16:27:22 -07:00
Eric Anderson cb15779e59 Use class name, not instance, for invoking static method 2015-07-06 16:27:21 -07:00
Eric Anderson 10578e31c0 param in JavaDoc is lower-case 2015-07-06 16:27:21 -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
Xudong Ma 1b3f9a3cde Add an option to Android interop test, to configure TLS protocol on SSLCertificateSocketFactory directly.
This is how our current internal users configure the TLS protocol, with this option, we can test and verify future changes will not break internal users.
2015-07-06 11:11:38 -07:00
Eric Anderson 74b5d29c8a Improve Exception backtrace for blocked streaming
Delaying creating the exception produces a much more useful exception.
The status code, description, and exception type are all identical. The
only difference in the backtrace.
2015-07-01 16:39:15 -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
Eric Anderson 05f5a4fb3b Suggest -PskipCodegen in run-test-{client,server}
Just helps new users wanting to try things out from thinking they need
to deal with compiling our protoc plugin. As seen in #581
2015-07-01 13:44:28 -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
Kun Zhang 7a71627e86 Add the bintray repository for Maven protoc-plugin in the example 2015-06-30 23:11:41 -07:00
zsurocking af70397d88 Merge pull request #579 from zsurocking/master
Use hostname instead of InetAddress for Socket creation.
2015-06-30 21:52:13 -07:00
Xudong Ma a0241d8d88 Use default type of KeyStore in Android interop test App, so that it can work on lower versions.
The previously used "AndroidKeyStore" was introduced in Android 4.3
2015-06-30 15:18:14 -07:00
Xiao Hang 3777b8bf65 Use hostname instead of InetAddress for Socket creation.
On Android platform, the constructor using hostname will iterate through all solved ip address for making connection.
Before we implement happy eyeballs, this could be a workaround for Android users.
2015-06-29 19:12:15 -07:00
Xudong Ma f88779e422 Add the Android interop test App.
So far, it is built separately from the other gRpc components.
2015-06-26 15:31:14 -07:00
Eric Anderson a479c9116a Move timeout marshaller tests to ChannelImplTest
Now that ChannelImplTest exists, it makes more sense for them to be
there, since the implementation is in ChannelImpl.
2015-06-26 12:19:42 -07:00
Eric Anderson 45da9c5766 Add a few ChannelImpl tests and improve error status 2015-06-26 12:19:41 -07:00
Eric Anderson 9a2db9d7d9 Make ChannelImpl.obtainActiveTransport's fast path lock-free
Resolves #479
2015-06-26 12:19:41 -07:00
Xudong Ma 6e406ac4a5 Refactor OkHttpProtocolNegotiator, move Android related operations into an inner class. 2015-06-26 09:59:22 -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 c7403127ea Revert swapping to the "canonical HTTP mapping"
The mapping is poorly suited for gRPC. C and Go don't even do any
mapping. We can improve the mapping in the future, but it is very
important that users don't start depending on the current mapping.

This change is "inspired by" the original code, but is even more
conservative.

Fixes #477
2015-06-25 12:15:34 -07:00
Louis Ryan a02503ada7 Add instructions for setting up traffic shaping on loopback
Enable benchmarks to detect shaped loopback binding and use it
2015-06-24 15:49:59 -07:00
Louis Ryan a69fbb0a2b Use 1MB as the max payload size in benchmarks to avoid exceeding Netty's buffer pool
default max buffer size.
2015-06-24 14:34:06 -07:00
nmittler ae2b5bfda7 Exposing AbstractBufferingHandler so it can be used by custom protocol negotiators. 2015-06-24 13:59:33 -07:00
Eric Anderson 74490d5f6b In compiler documentation, use grpc-java as plugin name
grpc-java is the implicit name of our plugin, due to its file name. No
need to use another name for it.
2015-06-24 13:13:03 -07:00
Xudong Ma 131ba5d1da Make the code clearer, fixes #531. 2015-06-19 12:59:52 -07:00