Commit Graph

1365 Commits

Author SHA1 Message Date
Kun Zhang 01bf56bf8d Fix placeholder in the error message of Preconditions.
Only '%s' is allowed.
2015-11-13 14:58:35 -08:00
Louis Ryan c40d702068 Switch to use Executor instead of ExecutorService where we don't need it 2015-11-12 15:30:15 -08:00
Carl Mastrangelo b0c626c359 Update Load balancing URI parsing and add tests 2015-11-11 17:50:30 -08:00
Kun Zhang 5529b6489b Create BlankFutureProvider which is reused among LoadBalancers.
If a LoadBalancer is requested for a transport future before it can get
one from TransportManager, e.g., before name resolution is completed,
LoadBalancer will return a blank future created by BlankFutureProvider
and to be linked with real futures later.
2015-11-11 15:20:09 -08:00
Carl Mastrangelo 05b7d75029 Re add support for periods in metadata key names 2015-11-10 15:59:42 -08:00
Carl Mastrangelo 3b82484281 Minor cleanup of ClientCallImpl header normalization 2015-11-10 13:52:06 -08:00
Carl Mastrangelo dc375500d6 Update -bin header restrictions, and re introduce string interning. 2015-11-10 13:40:02 -08:00
Carl Mastrangelo 2ad35b8269 Add Header name character restrictions 2015-11-10 11:20:04 -08:00
Louis Ryan 49b513504c Remove notion of stack from thread-local binding, use simple swapping instead.
This allows for binding state to be reset to known-good states precisely which in turn
facilitates making it safe to have 'detach' not throw exceptions and instead log
a severe error that attach/detach calls were not correctly balanced.
2015-11-09 13:17:18 -08:00
Carl Mastrangelo d2046b637d Allow commas in Metadata values 2015-11-09 12:39:53 -08:00
Carl Mastrangelo e9c9d31704 Add even more coverage 2015-11-09 12:35:24 -08:00
Eric Anderson a5d9e34bd6 Add Executor wrapping to Context 2015-11-09 10:59:53 -08:00
Carl Mastrangelo a691752165 Add simple tests for OkHttpProtocolNegotiator coverage 2015-11-06 13:15:28 -08:00
Kun Zhang 38ba586e0c Migrating from Objects.ToStringHelper to MoreObjects.ToStringHelper.
The former is deprecated.
2015-11-04 10:04:12 -08:00
Nathan Mittler 03ec0b863a Merge pull request #1187 from nmittler/use_serverbuilder_interface
Use ServerBuilder interface in AbstractTransportTest.
2015-11-04 08:42:09 -08:00
nmittler 9a5c9cdcbd Use ServerBuilder interface in AbstractTransportTest. 2015-11-04 08:05:31 -08:00
Nathan Mittler 872ecf4ee2 Merge pull request #1186 from xuwei-k/patch-1
fix typo
2015-11-04 06:54:00 -08:00
kenji yoshida 8301121db0 fix typo 2015-11-04 14:09:14 +09:00
nmittler 8c7e251f41 Allow Netty server override for ProtocolNegotiator
Server implementation had to be refactored to use a ProtocolNegotiator to make this work.
2015-11-02 13:04:37 -08:00
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