Commit Graph

2084 Commits

Author SHA1 Message Date
Carl Mastrangelo e8aef5b4bb Start 1.2.0 development cycle 2017-01-30 16:40:12 -08:00
Carl Mastrangelo fdeade4ee2 netty: work around netty bug when RPCs may be reset early
For netty/netty#6296
2017-01-30 16:09:19 -08:00
Carl Mastrangelo 237a65ebfc core: make ServiceDescriptor use the Builder pattern 2017-01-30 15:22:40 -08:00
Eric Gribkoff e08034cde0 documentation: new server reflection tutorial 2017-01-30 12:57:48 -08:00
Carl Mastrangelo 0c0ce37bbd all: upgrade to netty 4.1.8 and tcnative Fork26 2017-01-30 12:40:46 -08:00
Carl Mastrangelo cbe0ecd5e2 all: fix linter found on import 2017-01-27 15:47:53 -08:00
Carl Mastrangelo 566d0e9400 testing: change names of noopMarshaller to void marshaller
This is needed because in interceptor tests, often the types cannot
be changed.  The void methods stay for users who are writing tests
where they actually don't care about types.  The noop methods
require types to be specified.  This is for users who don't care
about the implementation.  These represent different levels of
commitment.

This eases the transition of code Mocking MethodDescriptor, which
breaks in this release.
2017-01-27 14:41:38 -08:00
Kun Zhang 9983a7b9e4 docs: security requirement of NameResolver.getServiceAuthority() (#2665)
In response to #2662
2017-01-27 09:27:47 -08:00
Eric Anderson 65e4d9f47a all: avoid DNS with GRPC_PROXY_EXP
In some environments DNS is not available and is performed by the
CONNECT proxy. Nothing "special" should need to be done for these
environments, but the previous support took shortcuts which knowingly
would not support such environments.

This change should fix both OkHttp and Netty. Netty's
Bootstrap.connect() resolved the name immediately whereas using
ChannelPipeline.connect() waits until the address reaches the end of the
pipeline. Netty uses NetUtil.toSocketAddressString() to get the name of
the address, which uses InetSocketAddress.getHostString() when
available.

OkHttp is still using InetSocketAddress.getHostName() which may issue
reverse DNS lookups. However, if the reverse DNS lookup fails, it should
convert the IP to a textual string like getHostString(). So as long as
the reverse DNS maps to the same machine as the IP, there should only be
performance concerns, not correctness issues. Since the DnsNameResolver
is creating unresolved addresses, the reverse DNS lookups shouldn't
occur in the common case.
2017-01-27 09:27:07 -08:00
Eric Anderson 23f5a6ff2a Add support for http forward proxy with CONNECT
This is a squash and modification of master commits that also includes:
netty,okhttp: Fix CONNECT and its error handling

This commit has been modified to reduce its size to substantially reduce
risk of it breaking Netty error handling. But that also means proxy
error handling just provides a useless "there was an error" sort of
message.

There is no Java API to enable the proxy support. Instead, you must set
the GRPC_PROXY_EXP environment variable which should be set to a
host:port string. The environment variable is temporary; it will not
exist in future releases. It exists to provide support without needing
explicit code to enable the future, while at the same time not risking
enabling it for existing users.
2017-01-27 09:27:07 -08:00
Kun Zhang 5bfac218f3 grpclb: add GrpclbLoadBalancerFactory2 2017-01-26 16:27:31 -08:00
Kun Zhang 0e6cf9971b core: open up LBv2 APIs for early adopters. 2017-01-26 16:27:31 -08:00
Łukasz Strzałkowski aa0391a427 core: pass down addr to which client is connected
This addresses #2613
2017-01-26 15:11:39 -08:00
Carl Mastrangelo 89bc2cd3b2 all: update to latest import ordering 2017-01-26 13:43:06 -08:00
Kun Zhang 0428556ce4 core: allow LBv2 impls to be stripped out by ProGuard. (#2654)
This should address the concern of increased method count as mentioned
in #2650.
2017-01-25 15:06:39 -08:00
Kun Zhang f088b81fc8 core: stop "testing" from depending on "core"'s test. (#2652)
Because "core"'s test source already depends on "testing", e.g.,
`core/src/test/java/io/grpc/internal/ServerCallImplTest.java` uses
`testing/src/main/java/io/grpc/internal/testing/StatsTestUtils.java`,
which forms a circular dependency.

This change moves the StatsContext setter accessors from "core"'s test
source to "testing".

Resolves #2651
2017-01-25 07:57:12 -08:00
dapengzhang0 7d85e73b23 ForwardingClientCall.getAttributes should call delegate 2017-01-24 09:11:23 -08:00
Eric Gribkoff 5bae984a88 services: remove no-op call in reflection service test
Now that the fix for #2444 is in, there's no need for the initial noop call.
2017-01-23 17:56:13 -08:00
Carl Mastrangelo 40bc50212b core: remove with* methods from MethodDescriptor 2017-01-23 15:41:40 -08:00
Lukasz Strzalkowski b33d3cb170 core: rename getAttr() and use standard getAttributes() 2017-01-23 15:06:00 -08:00
Łukasz Strzałkowski 8882abaa09 core: rename attributes() -> getAttributes()
Make it consistent with its counterpart, ClientStream#getAttributes()
2017-01-23 15:04:51 -08:00
Carl Mastrangelo efbcd1f1b9 core: change method descriptor to be builder based 2017-01-23 12:29:35 -08:00
Eric Anderson e9fa8c99ce core: Only use scheduled executor for timer tasks
This removes an abuse of scheduled executor in ManagedChannelImpl. The executor
was used to avoid deadlocking. Now we run the work on the same thread, but
delay it until locks have been released.

There is no need to fix ManagedChannelImpl2. Due to its different
threading model it didn't have need to abuse the scheduledExecutor.

Fixes #2444
2017-01-23 11:24:25 -08:00
Eric Anderson 06c40dccc3 android: Fix ProGuard rules in Android apps
Fixes #2207. This is actually a workaround. Ideally users shouldn't need
to -keep classes, but it's a bit risky to fix the real issue before 1.1.
The further fix will be done as part of #2633.

The interop app's build.gradle change is necessary to compile with newer
Gradle versions. The com.google.errorprone.annotations was necessary in
order to prevent annotation warnings from failing the build.
2017-01-23 09:11:09 -08:00
Carl Mastrangelo a4e481b3f9 core: make ServiceDescriptor check input values
Fixes: #2357
2017-01-20 17:22:14 -08:00
Kun Zhang 737cd16a38 core: make StatsContextFactory setters protected (#2634)
These are only used in internal tests.  In production,
StatsContextFactory is loaded by the "Instrumentation" library and must
be one per process, thus we won't allow setting it on a per-channel or
per-server basis.
2017-01-20 17:20:44 -08:00
ZHANG Dapeng 018e2d5307 all: make some api non-experimental for 1.1 2017-01-20 16:34:56 -08:00
Kun Zhang 8a4c7bdf7f docs: clarify requirements of detach(). (#2630) 2017-01-20 15:31:04 -08:00
Eric Anderson 2bd74c5a92 core: cancel RPC when exception in server onReady
Fixes #2305
2017-01-20 10:47:11 -08:00
Eric Anderson f51316b84a testing: Move echo interceptors out of TestUtils
The interceptors are quite specific, and probably not helpful for
current testing strategies. They really are only useful for interop
testing. Moving them to interop-testing avoids them appearing to be in a
public API (even if that API is experimental).

No functional changes were made; just code movement.
2017-01-19 17:04:31 -08:00
Carl Mastrangelo d5eb248737 all: bump to netty 4.1.7 2017-01-19 15:24:26 -08:00
Lukasz Strzalkowski 060eb45623 Rename attributes() to getAttributes() to make it consistent 2017-01-19 12:53:54 -08:00
Carl Mastrangelo 4988d8be6b thrift: disable export of artifact
Addresses: #2099
2017-01-19 12:48:55 -08:00
Eric Anderson 1e99b299e1 all: ErrorProne fixes and avoid @Beta in Guava 2017-01-19 12:16:05 -08:00
Kun Zhang 5a4794f2c8 core: add debug information in MessageDeframer. (#2622)
So that MessageDeframer would include the class name of the enclosing
stream when emitting errors.  This should give us more information about #2157
2017-01-18 17:23:29 -08:00
Kun Zhang fa8f1150cb docs: fix deprecation reference in ClientAuthInterceptor. (#2621) 2017-01-18 16:25:57 -08:00
Łukasz Strzałkowski 6494a17c5b RoundRobinLoadBalancer minor cleanups (#2611)
* Remove else, make it easier to read

* Ready subchanns list will be at max the same as the input list

* Make status private, add pkg-private getter for tests

* Remove empty field, cache size, simplify logic

Make list unmodifiable. Document index with GuardedBy (see #nextSubchannel())
2017-01-18 14:40:30 -08:00
Kun Zhang d0d2c1e796 docs: add links to examples and tutorials. (#2614) 2017-01-18 09:06:45 -08:00
ZHANG Dapeng d87a6587a4 core,netty: add getAttributes to ClientStream and ClientCall (#2526)
add `getAttributes()` to `ClientStream` and `ClientCall` to be able to share clientTransport
information such as socket TOS with higher lever API's, once the RPC picks up an active transport that is ready to use.
2017-01-17 20:33:37 -08:00
Carl Mastrangelo c4642f8b3d compile: add std:: to all stl types 2017-01-17 12:50:25 -08:00
Kun Zhang 527d243ec0 core: more logs in ManagedChannelImpl. (#2606)
They have already been added to ManagedChannelImpl2.

Resolves #2299
2017-01-17 09:36:02 -08:00
Eric Gribkoff d59973c925 core,services: separately index mutable and immutable services
Updates the proto reflection service to process immutable services once and
mutable services as-needed.
2017-01-13 17:46:56 -08:00
Kun Zhang c436d93f07 core: ServerImpl returns shared resources at termination (#2605)
Previously it does it at shutdown, which was wrong because executor may
still be used before the server is terminated.

Resolves #2034

Uses ObjectPool to make this change testable.  Cleans up test and makes
it mostly single-threaded, except for two deadlock tests that have to be
multi-threaded.
2017-01-13 09:00:32 -08:00
Carl Mastrangelo ec7f00a272 core,testing: make MethodDescriptor final and add Test helper 2017-01-11 17:30:14 -08:00
Carl Mastrangelo ce3a94bacc core: promote experimental methods in MethodDescriptor 2017-01-11 17:07:53 -08:00
Jorg Heymans 5408b92fd4 documentation: fix SECURITY.md example 2017-01-11 13:28:07 -08:00
Carl Mastrangelo b5b9ba5604 core: fix bug with Metadata merging 2017-01-11 13:23:46 -08:00
Carl Mastrangelo 3144a4fcd6 proto: remove deprecated methods 2017-01-11 13:23:02 -08:00
Carl Mastrangelo 8493498a54 core: remove thisT() from API 2017-01-11 12:46:47 -08:00
Carl Mastrangelo 813cb090af core: make getResponseMarshaller experimental in MethodDescriptor 2017-01-11 11:22:01 -08:00