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.
- 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.
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.
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.
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.
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.
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.
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
Previously, it always threw a RuntimeExecutionException with a
StatusRuntimeException within (since the only callers of setException()
provide a StatusRuntimeException).
Resolves#507
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.
1. Move DEFAULT_CONNECTION_SPEC to OkHttpChannelBuilder
2. make OkHttpClientTransport package-private
3. Rename OkHttpChannelBuilder.setConnectionSpec to connectionSpec
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.