Commit Graph

996 Commits

Author SHA1 Message Date
Eric Anderson 7767138c96 Use assertEquals instead of assertTrue(Range.contains)
It likely will produce a better error message and doesn't require using
as large of an API/impl.
2015-11-02 11:07:25 -08:00
Eric Anderson 6229c2ca61 Brew update twice, to work around Brew issue 2015-11-02 09:09:10 -08:00
nmittler e775885be2 Allow client to specify ProtocolNegotiator in NettyChannelBuilder. 2015-11-02 09:02:41 -08:00
nmittler b9195fb9aa Set connectionWindow to MAX_INT.
This is a temporary fix for https://github.com/grpc/grpc-java/issues/1175. We will revisit this change after auto-refill is supported in Netty.
2015-10-30 12:29:31 -07:00
Xudong Ma 750b1977ca Make the header list size limit configurable on both client and server side. 2015-10-30 10:52:47 -07:00
Kun Zhang a4f319f0c3 Clarify the audience of internal API. 2015-10-29 16:32:00 -07:00
nmittler 23e2df9a67 Allowing AbstractBufferingHandler to be extended. 2015-10-29 11:06:09 -07:00
Xudong Ma 52c9aac1c1 [OkHtpp] Correct windowUpdateWithInboundFlowControl test. 2015-10-29 08:52:57 -07:00
Carl Mastrangelo b287d1dbc8 Deflake Call Options test 2015-10-28 13:44:25 -07:00
Carl Mastrangelo c53b5170ca Downgrade mockito, and fix tests 2015-10-28 12:57:10 -07:00
Kun Zhang ac02e206e8 Fix javadocs of NameResolver 2015-10-28 11:50:42 -07:00
Kun Zhang b5b79642c5 Fix a NPE in ManagedChannelImpl.
The error occurs when name resolution completes after the channel is
shut down. What ManagedChannelImpl doing right now is violating the
TransportManager interface, because TransportManager.getTransport()
should never return null.
2015-10-28 11:32:15 -07:00
Eric Anderson cea8e8e4a7 Add tests for nano proto
Since some of the tests would need only minor modification to work for
normal proto, normal proto got a few more tests as well.
2015-10-28 10:00:41 -07:00
Carl Mastrangelo 122f93c26d Add unit tests for SizeEnforcingInputStream 2015-10-28 09:34:46 -07:00
Eric Anderson 353aabce51 Increase coverage for CallOptions 2015-10-28 09:31:42 -07:00
nmittler 3efc61b237 Guard against NPE in Netty handlers
We've seen an NPE as a side-effect of a failure in protocol negotiation:

Oct 27, 2015 9:27:09 PM io.grpc.transport.netty.ProtocolNegotiators$AbstractBufferingHandler fail
SEVERE: Transport failed during protocol negotiation
java.lang.NullPointerException
	at io.grpc.transport.netty.NettyClientHandler$2.visit(NettyClientHandler.java:218)
2015-10-28 08:38:59 -07:00
Xudong Ma a2216f665a Deflake OkHttpClientTransportTest. 2015-10-27 14:26:36 -07:00
Kun Zhang edd57c941e Support default port in NameResolver.
- Channel builders decide the default port based on whether TLS is used.
- Channel builders populate the default port via an Attributes object
  passed to NameResolver.Factory#newNameResolver
2015-10-27 13:54:36 -07:00
Eric Anderson 63f1482ad6 Increase code coverage of Context
A few minor bugs were discovered and fixed.
2015-10-27 11:22:56 -07:00
Carl Mastrangelo 5487c42713 Update okhttp javadoc 2015-10-27 10:10:35 -07:00
Carl Mastrangelo db56c2463e Add followup ProtocolNegotiators.tls tests 2015-10-26 12:19:07 -07:00
Carl Mastrangelo dd815bc968 Add initial Protocol Negotiation tests 2015-10-26 11:46:52 -07:00
Eric Anderson 2c2d7171ec Assert that timeouts didn't occur in Context tests
Although it is unlikely the awaits return false, it would be useful
information to know about the failure if they did.

This should provide more clues in case the test flakes again (#1146)
2015-10-23 14:31:12 -07:00
Eric Anderson 579e65cb97 Simplify Jenkins configuration on Windows
Without the attributes, fc loses its mind a bit when comparing the
codegen output against the golden; the golden would have DOS newlines
(assuming default git configuration) and the generated code would have
Unix newlines.

The jenkins-pre script just reduces the amount of code is backed into
the jenkins project.
2015-10-23 13:46:37 -07:00
Eric Anderson 209d3a3f38 Upgrade gradle to 2.8
This fixes a problem where gradle would try to use VC's amd64_x86 cl
(without the correct environment) and fail to compile with return code
-1073741515 (STATU_DLL_NOT_FOUND) because of missing mspdb120.dll.
2015-10-23 13:46:37 -07:00
Eric Anderson 2467d618b7 Correct path for dep building short-circuiting 2015-10-23 13:46:37 -07:00
nmittler 6f64999821 Addressing concurrency issue in MessageFramer.
Fixes (hopefully): #991
2015-10-23 13:00:23 -07:00
Carl Mastrangelo f39b67c0e8 Add uri checking 2015-10-23 11:13:03 -07:00
Kun Zhang efac679abc NameResolverRegistry and better-defined target string.
- NameResolverRegistry contains all the official NameResolvers. Users
  can also add custom NameResolvers to it. It looks up NameResolver by
  try-and-fail. It is the default NameResolver.Factory for builders.
  DnsNameResolver.
- Pass target as Strings instead of URIs from the channel builder to
  ManagedChannelImpl. A target string is not necessarily a valid URI, in
  which case ManagedChannelImpl will add "dns:///" to the beginning of
  the target and use it as URI.
- DnsNameResolver will require scheme "dns" to be present. It no longer
  allows scheme-absent URIs.
2015-10-23 09:37:22 -07:00
Eric Anderson 6dc5e8075b Support OS X on Travis 2015-10-23 09:27:07 -07:00
Kun Zhang 17597ce9cf Pass the initial transportFuture to DelayedStream.
Otherwise, when DelayedStream is created it ends up calling
clientTransportProvider a second time. However, we already have a
transportFuture available, we should just use it instead.
2015-10-22 17:00:35 -07:00
Eric Anderson 33e26cdaa4 Delete ManagedChannelImplTest.transportFailsOnStart
transportFailsOnStart was still flaky. By looking at history, it became
obvious that transportFailsOnStart was created to test two cases we no
longer support: the transport throwing an exception during start and the
transport calling listener.transportShutdown during start. The part of
the test checking throwing an exception was removed earlier.
2015-10-22 15:42:50 -07:00
Carl Mastrangelo 74088c4fb4 Allow authority override to be propagated to Protocol Negotiators 2015-10-22 15:27:07 -07:00
Eric Anderson 16c4c49e94 Fix flake in ManagedChannelImplTest.transportFailsOnStart
The scheduling on another thread led to a race where sometimes the
future wasn't completed by the time isDone() was checked in
ClientCallImpl causing the usage of DelayedStream, which really messed
up what the test was trying to do.
2015-10-22 12:53:30 -07:00
Kun Zhang 942f4c99d8 Load-balancing ManagedChannelImpl.
- Add NameResolver and LoadBalancer interfaces.
- ManagedChannelImpl now uses NameResolver and LoadBalancer for
  transport selection, which may return transports to multiple
  addresses.
- Transports are still owned by ManagedChannelImpl, which implements
  TransportManager interface that is provided to LoadBalancer, so that
  LoadBalancer doesn't worry about Transport lifecycles.
- Channel builders can be created by forTarget() that accepts the fully
  qualified target name, which is an URI. (TODO) it's not tested.
- The old address-based construction pattern is supported by using
  AbstractManagedChannelImplBuilder.DirectAddressNameResolver.
- (TODO) DnsNameResolver and SimpleLoadBalancer are currently
  incomplete. They merely work for the single-address scenario.
2015-10-20 17:28:44 -07:00
Xudong Ma bfbd6e1ec5 Expose unimplemented_method test to interop test client. 2015-10-18 10:48:02 -07:00
Carl Mastrangelo ce93051aad Cover more low hanging fruit 2015-10-16 15:27:59 -07:00
Nathan Naze 80eb60080d modify .gitignore to ignore Emacs files 2015-10-16 13:24:37 -07:00
Xudong Ma 5667f0e3a6 Add "using std::to_string" to java_generator.cpp, it is needed by internal version. 2015-10-16 09:32:36 -07:00
Xudong Ma b121c46b42 Reduce OkHttp dependency, copy all the needed files into our repository. 2015-10-15 16:35:08 -07:00
Xudong Ma 6d296e84b6 Upgrade OkHttp to 2.5 2015-10-15 16:35:08 -07:00
Xudong Ma b1430aeda8 Expose timeout_on_sleeping_server test to interop test client. 2015-10-14 16:31:25 -07:00
Eric Anderson a62db8f283 Update comment; Parser was replaced with NanoFactory 2015-10-14 13:54:23 -07:00
Eric Anderson 1ee336d244 Use one codegen class for all Nano factories
This reduces the number of classes defined, which reduces memory usage.
It also reduces the number of methods defined, which is important
because of the dex limit.

This should have virtually zero performance degration because the
contiguous switch uses tableswitch bytecode.

ARG_IN_ and ARG_OUT_ are prefixes as otherwise there could be a name
collision with an oddly-named method. Since the other fields are
prefixed with METHOD_ they can't collide.
2015-10-14 13:53:22 -07:00
Carl Mastrangelo 8138308cdb Up code coverage for Metadata 2015-10-13 16:21:44 -07:00
Xudong Ma 72a0a38182 [okhttp] Make sure transportShutdown() always be called before calling transportTerminated(). 2015-10-12 16:34:55 -07:00
Carl Mastrangelo 6474938fe7 Allow non-host based authorities in OkHttp transport 2015-10-08 15:32:30 -07:00
Xudong Ma 996ea2fc22 Give dependency example for android clients. 2015-10-07 16:08:36 -07:00
Carl Mastrangelo d42a09b0e4 Add authority work around for OkHttp channels 2015-10-07 15:04:49 -07:00
Eric Anderson a61beefc06 Update documentation for CGM, in light of jre8u60
JRE 8u60 is still slow, but could be used by someone that doesn't care
about performance now. Added more details about relative performance so
that the gains of OpenSSL are clear.

Added detail about version independence, because JRE 8u60 requires an
update to Jetty ALPN, so it is also applicable to this change.
2015-10-07 14:22:27 -07:00