Commit Graph

1602 Commits

Author SHA1 Message Date
Doug Clark 121549697f docs: update documentation for client TLS in SECURITY.md 2016-06-09 08:41:47 -07:00
William Thurston a05ab57561 core: emit lists of lists from NameResolver 2016-06-09 08:30:55 -07:00
Eric Anderson 03d9450968 netty: Use uber boringssl jar 2016-06-08 10:26:49 -07:00
Eric Anderson 3f5a154a2d netty: Bump Netty dependency to 4.1.1.Final
Bumping tcnative was not required to be done at the same time as Netty.
But the new tcnative should now work correctly on Windows and be smaller
on Linux.
2016-06-08 10:25:46 -07:00
Eric Anderson 7c722e440e codegen: Specify URL for ExperimentalApi
Fixes #1378. These are the last ExperimentalApis that didn't have their
own separate tracking issue.
2016-06-07 15:00:29 -07:00
Kun Zhang 05ce5455da core: A missed-out test for #1896 2016-06-07 11:57:25 -07:00
ZHANG Dapeng b88ea27b53 core/internal: add 3-arg newStream method to ClientTransport interface (#1898)
adding 
ClientStream newStream(MethodDescriptor<?, ?> method, Metadata headers, CallOptions callOptions);
to ClientTransport interface

Created this PR first because both fail fast implementation and another change will be using this interface change
2016-06-06 19:43:15 -07:00
Jakob Buchgraber 53cd333531 core: add test for complete() without close() exception in AbstractServerStream. Fixes #615 2016-06-03 07:27:57 +02:00
Carl Mastrangelo 0021e063f2 benchmarks: reset context in AsyncClient to avoid chaining.
Fixes #1878
2016-06-02 21:41:43 -07:00
Eric Anderson c6fd94ca85 Implement shutdownNow
Fixes #448
2016-06-02 17:39:59 -07:00
Kun Zhang 631a9d5fac Fix URI construction.
This fixes two issues.

1) Use the URI constructor with multiple arguments to construct the placeholder
URI for direct address, so that special characters can be correctly
escaped. This resolves #1883.

It requires the second fix.

2) Stop URI from mistreating paths as authorities.

There is a bug in URI constructors that take multiple arguments.  They simply
concatenate escaped components and try to parse the resulting string.

For example, URI("dns", null, "//127.0.0.1", null), which is what we do
internally when the application passes "/127.0.0.1" as the target, is supposed
to create a [scheme="dns", path="//127.0.0.1"].  Instead, it internally composes
"dns://127.0.0.1", which is parsed into [scheme="dns", authority="127.0.0.1"].

To avoid this issue, we pass empty string instead of null as the authority to
the URI constructor. The constructor would make "dns:////127.0.0.1" internally
which can be parsed correctly.
2016-06-02 17:10:44 -07:00
Jakob Buchgraber d25b65bb53 testing: add tests for Netty bug where a channel would break after a RST_STREAM frame. Fixes #1682 2016-06-02 18:34:07 +02:00
Jakob Buchgraber c6c74799f4 netty: add toString() to GrpcHttp2Headers 2016-06-02 18:18:55 +02:00
elandau 90323ad5d4 core: add custom CallOptions 2016-06-02 09:14:48 -07:00
Carl Mastrangelo 2ed39c92eb core: cache decompressor registry encodings, and make it copy on write 2016-06-02 09:10:42 -07:00
Kun Zhang 90506405c9 Differentiate transport to LB services and to servers.
TransportManager has a new method, createOobTransportProvider(), which
accepts an EquivalentAddressGroup and the authority string. This
addresses two requirements:

1. Per GRPCLB protocol, connections to the remote load-balancer may use a
different authority than the channel's (#1137).

2. For idle state determination, Channel needs to exclude the transport to
the LB service when looking at live RPCs and (#1276).
2016-06-01 18:23:09 -07:00
Carl Mastrangelo 676bf4854f core: fix nags from linter 2016-06-01 13:58:07 -07:00
Carl Mastrangelo 02eb24b3bd core,netty,okhttp: move user agent removal closer to where it is set 2016-06-01 12:55:21 -07:00
Jakob Buchgraber 028d0844dd core: add test for deframer closed exception. fixes #1795 2016-06-01 20:44:29 +02:00
Carl Mastrangelo 134451f62c benchmarks: use nextUp for nextDelay calculation in OpenLoopClient 2016-05-31 14:05:48 -07:00
Kun Zhang c08d74fec4 TransportSet shutdown() also shuts down the pending transport.
Previously TransportSet.shutdown() only shuts down the active transport,
which means a transport will not be shutdown if it's not ready yet. This
issue was introduced by #1494 that postponed the assignment of the
active transport till transport ready.
2016-05-29 15:45:03 -07:00
Carl Mastrangelo 9f37951680 benchmarks: honor transport in AsyncClient 2016-05-27 11:55:18 -07:00
ZHANG Dapeng 361936401f core/internal: fix regex pattern 2016-05-26 14:02:15 -07:00
Eric Anderson 7052d8b5e9 core: Promote Deadline API to stable
Fixes #1706
2016-05-26 13:33:48 -07:00
Carl Mastrangelo fa22259e3a netty: use custom Http2Headers class for encoding Metadata
Before:
Benchmark                              (headerCount)    Mode     Cnt     Score    Error  Units
HeadersBenchmark.convertClientHeaders             10  sample  127008   631.214 ±  3.543  ns/op
HeadersBenchmark.convertClientHeaders             20  sample  142036  1125.874 ± 21.114  ns/op
HeadersBenchmark.convertClientHeaders             50  sample  117570  2678.635 ± 47.764  ns/op
HeadersBenchmark.convertClientHeaders            100  sample  115919  5427.720 ± 67.956  ns/op
HeadersBenchmark.convertServerHeaders             10  sample  133903   610.970 ±  3.094  ns/op
HeadersBenchmark.convertServerHeaders             20  sample  138155  1154.304 ±  4.595  ns/op
HeadersBenchmark.convertServerHeaders             50  sample  120078  2658.175 ± 38.679  ns/op
HeadersBenchmark.convertServerHeaders            100  sample  120509  5212.341 ± 49.062  ns/op

After:
Benchmark                              (headerCount)    Mode     Cnt     Score    Error  Units
HeadersBenchmark.convertClientHeaders             10  sample  102473   407.383 ±  2.693  ns/op
HeadersBenchmark.convertClientHeaders             20  sample  103205   791.241 ± 38.054  ns/op
HeadersBenchmark.convertClientHeaders             50  sample  173817  1840.311 ±  5.718  ns/op
HeadersBenchmark.convertClientHeaders            100  sample  169984  3690.753 ± 44.308  ns/op
HeadersBenchmark.convertServerHeaders             10  sample  103615   401.661 ±  2.922  ns/op
HeadersBenchmark.convertServerHeaders             20  sample   99060   823.453 ±  5.553  ns/op
HeadersBenchmark.convertServerHeaders             50  sample  171824  1846.788 ± 29.840  ns/op
HeadersBenchmark.convertServerHeaders            100  sample  171622  3670.354 ±  7.127  ns/op
2016-05-25 17:23:51 -07:00
Eric Anderson 149ce204e2 netty: Bump netty dep to 4.1.0.Final
Is such a thing even possible? Yes it is.

Note that HTTP/2 in Netty still is not stable, so we remain
version-pinned.
2016-05-25 16:58:51 -07:00
Carl Mastrangelo ca8e166591 okhttp: generate user agent once for whole transport 2016-05-25 16:37:54 -07:00
Carl Mastrangelo f172170649 benchmarks: use more realistic header counts in benchmark 2016-05-25 16:30:29 -07:00
Carl Mastrangelo 4204eb8cd9 core: allocate less garbage iterators in Metadata.serialize
Before:
HeadersBenchmark.convertClientHeaders             10  sample   99004   806.749 ±   4.692  ns/op
HeadersBenchmark.convertClientHeaders             20  sample  105673  1540.814 ±  86.361  ns/op
HeadersBenchmark.convertClientHeaders             50  sample  188978  3347.881 ±  71.778  ns/op
HeadersBenchmark.convertClientHeaders            100  sample  189913  6626.884 ±  94.348  ns/op
HeadersBenchmark.convertServerHeaders             10  sample  107884   766.328 ±  49.338  ns/op
HeadersBenchmark.convertServerHeaders             20  sample  122568  1303.501 ±   8.820  ns/op
HeadersBenchmark.convertServerHeaders             50  sample  109281  2920.586 ±  93.654  ns/op
HeadersBenchmark.convertServerHeaders            100  sample  196784  6429.566 ± 108.588  ns/op

After:
HeadersBenchmark.convertClientHeaders             10  sample  113274   715.382 ±  5.412  ns/op
HeadersBenchmark.convertClientHeaders             20  sample  128654  1294.677 ± 67.867  ns/op
HeadersBenchmark.convertClientHeaders             50  sample  112598  2814.925 ± 62.291  ns/op
HeadersBenchmark.convertClientHeaders            100  sample  116920  5383.146 ± 90.205  ns/op
HeadersBenchmark.convertServerHeaders             10  sample  130004   626.243 ±  3.528  ns/op
HeadersBenchmark.convertServerHeaders             20  sample  142054  1185.193 ± 80.272  ns/op
HeadersBenchmark.convertServerHeaders             50  sample  115153  2795.715 ± 92.956  ns/op
HeadersBenchmark.convertServerHeaders            100  sample  119520  5249.636 ± 56.089  ns/op
2016-05-25 15:12:40 -07:00
Carl Mastrangelo 1cc76d8132 core,netty,okhttp: move user agent out of client call and into the transport 2016-05-25 15:11:42 -07:00
nmittler c102dd4e4f Add trailers to Status for BlockingResponseStream
Fixes #1861
2016-05-25 12:04:55 -07:00
nmittler 6e40edbc21 Add trailers to Status for BlockingResponseStream 2016-05-25 06:54:31 -07:00
Eric Anderson 641cb357c6 Tweak -Xlint warnings
This now catches a few more places we needed -Xlint:-options.
InProcessSocketAddress is technically already in our stable API, so I
maintained its current serialVersionUID.
2016-05-24 15:04:07 -07:00
Eric Anderson e4ea237597 core: Refactor TransportSet in prep for fail fast
This is functionally equivalent. Some tests needed changes because they
were verifying internal behavior.
2016-05-24 14:40:07 -07:00
Carl Mastrangelo cca473df99 benchmarks: add client/server header benchmarks 2016-05-24 13:11:14 -07:00
Carl Mastrangelo 5e30b2f7ba netty: speed up header conversion by caching user agent string
Performance gain seems to be about 100-200ns based on a a couple trials.

Benchmark                                 (headerCount)  (validate)    Mode     Cnt     Score    Error  Units
HeadersBenchmark.convertClientHeadersOld             10       false  sample  187490   858.234 ±  3.992  ns/op
HeadersBenchmark.convertClientHeadersOld             20       false  sample  113589  1407.557 ± 45.178  ns/op
HeadersBenchmark.convertClientHeadersOld             50       false  sample  100725  3141.936 ± 55.175  ns/op
HeadersBenchmark.convertClientHeadersOld            100       false  sample  109742  5707.748 ± 38.222  ns/op
HeadersBenchmark.convertHeaders                      10       false  sample  109137   748.486 ±  4.060  ns/op
HeadersBenchmark.convertHeaders                      20       false  sample  133639  1238.528 ± 51.914  ns/op
HeadersBenchmark.convertHeaders                      50       false  sample  107914  2915.602 ± 10.017  ns/op
HeadersBenchmark.convertHeaders                     100       false  sample  110305  5682.404 ± 44.032  ns/op
2016-05-23 17:49:30 -07:00
Łukasz Strzałkowski ac9a5a5679 Make Code.status() public, add Status#fromCode()
Closes #1722
2016-05-23 17:03:48 -07:00
Eric Anderson 8033cdd3a7 core: Add unit test for Contexts.interceptCall 2016-05-23 13:51:10 -07:00
Eric Anderson 39d1e31547 netty: Fix test to support netty 4.1.0.Final 2016-05-23 13:22:18 -07:00
Eric Anderson 6382015f9d internal: Split-state AbstractStream; sending and receiving
This introduces an AbstractStream2 that is intended to replace the
current AbstractStream. Only server-side is implemented in this commit
which is why AbstractStream remains. This is mostly a reorganization of
AbstractStream and children, but minor internal behavioral changes were
required which makes it appear more like a reimplementation.

A strong focus was on splitting state that is maintained on the
application's thread (with Stream) and state that is maintained by the
transport (and used for StreamListener). By splitting the state it makes
it much easier to verify thread-safety and to reason about interactions.

I consider this a stepping stone for making even more changes to
simplify the Stream implementations and do not think some of the changes
are yet at their logical conclusion. Some of the changes may also
immediately be replaced with something better. The focus was to improve
readability and comprehesibility to more easily make more interesting
changes.

The only thing really removed is some state checking during sending
which is already occurring in ServerCallImpl.
2016-05-23 12:33:49 -07:00
Carl Mastrangelo 8090effa2d netty: don't revalidate when converting between Metadata and Http2Headers 2016-05-23 11:02:22 -07:00
ZHANG Dapeng b7eea7c13a implements health check service
resolves #647
2016-05-20 14:03:29 -07:00
Eric Anderson 65dd5db5e3 protolite: Use 'unused' variable to avoid CheckReturnValue
Internally toByteArray is annotated with CheckReturnValue, which can
cause a failure during compilation if the value is ignored.
2016-05-20 09:46:46 -07:00
Eric Anderson aa92d6c643 build: Update jetty for JDK 8u92 2016-05-19 11:43:48 -07:00
Carl Mastrangelo 8c7440e141 benchmarks: add NETTY_EPOLL as an option for transport testing 2016-05-18 16:37:42 -07:00
Carl Mastrangelo e19848092d core, interop-testing: always set message encoding, and use it in interop tests
This change updates the behavior of the core compression semantics.  Previously,
if the codec was "identity", nothing was set on the wire.  This is allowed by
the spec, but doesn't match what wrapped languages do.

Additionally, the interop tests will now attempt to honor the requested
compression.
2016-05-18 12:04:25 -07:00
Carl Mastrangelo 6a802a2027 benchmarks: revert use of CMS GC 2016-05-17 10:38:59 -07:00
Carl Mastrangelo d08c167bc7 benchmarks: use Concurrent Mark and Sweep GC for benchmark worker 2016-05-16 16:44:58 -07:00
Eric Anderson 5a2e5e16a2 android-interop-test: Enable checkstyle; fix violations 2016-05-16 12:44:15 -07:00
Carl Mastrangelo 2825361767 stub: use correct javadoc link for Guava 2016-05-16 10:25:03 -07:00