Commit Graph

2653 Commits

Author SHA1 Message Date
Eric Gribkoff 77e3b97f91 okhttp: add hpack test for max dynamic table size 2018-03-28 14:53:19 -07:00
Eric Gribkoff ecc36ac96d okhttp: include tests in third_party/okhttp 2018-03-28 14:53:19 -07:00
Eric Gribkoff 1efb695399 okhttp: rename ambiguous variables in Hpack reader 2018-03-28 14:53:19 -07:00
Eric Gribkoff b82366159b okhttp: fix HPACK reader bug 2018-03-28 14:53:19 -07:00
zpencer 14003c14cc
build.gradle: bump protobuf plugin to 0.8.5 (#4101)
This update automatically adds generated sources and proto IDLs to the
`idea` plugin.
2018-03-26 17:29:55 -07:00
Eric Anderson 3bb6708eee services: Specify serialVersionUID for the dummy SocketAddress
This fixes a serial warning that breaks the build when building
_without_ ErrorProne. I have no clue why _disabling_ ErrorProne makes
the warning pop up, but whatever, the warning is legit.

I also gave it a name, since the anonymous $1 seems weird if we're
providing a serialVersionUID. Not to say we're actually supporting
serializing this object. But if we ever see a serialized form show up in
the future, having a more clear name would make it obvious what it is.
2018-03-26 16:57:09 -07:00
Eric Anderson 25f357699a
okhttp: Convert to internal ConnectionSpec eagerly
This allows ProGuard to remove OkHttp's ConnectionSpec in most cases,
saving about 40 methods. The savings won't be realized until
DEFAULT_CONNECTION_SPEC is removed.
2018-03-26 15:39:56 -07:00
zpencer 6b753bdc35
buildscripts: add explicit dependency on appengine SDK (#4269)
This fixes the following in GAE:
java.lang.ClassNotFoundException: com.google.appengine.api.ThreadManager
2018-03-26 15:34:17 -07:00
ZHANG Dapeng db64c36af2
core: no retry on dropped PickResult
Address #3553 for normal retry. Not covering the unimplemented hedging case.
2018-03-26 14:57:12 -07:00
Amit Desai 8fe313f598 Marking GrpcServerRule as final
Resolves #4239
2018-03-23 16:34:20 -07:00
Eric Anderson 5f0ee3a725
Bump to Guava 20
Fixes #4176
2018-03-23 15:45:05 -07:00
zpencer a5b55bb24c
netty,okhttp,testing: always set TRANSPORT_ATTR_REMOTE_ADDR (#4217)
Always set the remote address, no reason why this should be a TLS-only
feature. This is needed for channelz, and is especially useful in unit
tests where we are using plaintext.

This PR adds the attr for plaintext.
2018-03-23 15:44:40 -07:00
Ray Tsang ae42d666ad SECURITY.md: Added more troubleshooting instructions 2018-03-23 11:05:57 -07:00
Eric Anderson 7eab0d9468 netty: Add support for Conscrypt 2018-03-23 10:05:45 -07:00
Eric Anderson 0859d480e7 Move TlsTest from interop-testing to netty 2018-03-23 10:05:45 -07:00
zpencer 0955866d5a
core,services: implement binarylog Client and ServerInterceptor (#4174)
- To make unit tests easier, added the BinaryLogSinkWriter abstract
  class, which allows verifying high level arguments rather than low
  level protobufs.
- remove InputStream based marshaller (IDENTITY_MARSHALLER) in favor
  of byte[] because retries will need to call serialize multiple
  times. This is achieved with a special InputStream that lets us
  access the internal byte[] without copying.
- Change ByteBuffer based internal methods to use byte[]
- Update unit tests to reflect the above
2018-03-23 09:29:24 -07:00
Jan Tattermusch 92f95de3cb routeguide: reimplement distance calculation 2018-03-23 08:25:26 -07:00
zpencer 19a64cc336
buildscripts: build windows artifacts in kokoro (#4253)
We always build the artifacts, but only store them in placer via
kokoro if MVN_ARTIFACTS is set to a non empty value.

The 32 bit script runs tests as well as builds artifacts.
The 64 bit script only builds artifacts.
2018-03-22 17:56:59 -07:00
Kun Zhang a43845622f
grpclb: Cache Subchannels for 10 seconds after it is removed from the backendlist (#4238)
This is to conform with the GRPCLB spec. The spec doesn't (yet) define
the actual timeout. We choose 10 seconds here arbitrarily.  It may be
configurable in the future.

This will fix internal bug b/74410243
2018-03-22 17:30:02 -07:00
Eric Gribkoff 6160727274
README.md: fix maven central link (#4256) 2018-03-22 16:22:18 -07:00
Eric Gribkoff 5337728fa7
core,netty: client sends rst stream when server half-closes (#4222) 2018-03-22 12:38:42 -07:00
ZHANG Dapeng ca55b6f7e7
cronet: allow application to provide all threads 2018-03-21 15:04:31 -07:00
Carl Mastrangelo 7c69c3a867
core: disable jndi lookups 2018-03-21 12:55:54 -07:00
ZHANG Dapeng 900b39635d
core: Fix java lint found during weekly import 2018-03-20 17:45:26 -07:00
Eric Gribkoff 52fedb624d
okhttp: support JDK9 ALPN (#4136) 2018-03-20 17:29:24 -07:00
Eric Anderson 5241172475 build.gradle: Filter -Xep instead of just -Xep:
-XepFilterPaths should be included in the filtering, otherwise
-PerrorProne=false will fail. I broke this in 1fb72ef6
2018-03-20 17:24:06 -07:00
Eric Anderson 7b111d2d00 benchmarks: Modernize TLS configuration
NIO does not mean to use Jetty ALPN; the only reason to use Jetty ALPN
is to test OkHttp. We don't need to disable ciphers to test Java 7
(except for OkHttp, which we don't care about on Java 7 and it wasn't
plumbed already) and we _really_ don't want people to copy the code to
do so. useTransportSecurity()/usePlaintext() are preferred over the
transport-specific NegotiationType.
2018-03-20 17:15:04 -07:00
Kun Zhang 1e0875dff7
core: re-enable panic mode after all affected internal tests have been fixed. (#4245) 2018-03-20 13:06:41 -07:00
ZHANG Dapeng 6836b31fb3
core: catch and log Throwable for jndiResolver.resolve(host)
JndiResolver.resolve may throw Error that could cause rpc to hang. Catch and log Throwable and keep using jdkResolver's result to prevent it.
2018-03-20 13:02:52 -07:00
ZHANG Dapeng 95917b8f28
core: parse retry policy from service config 2018-03-19 15:15:59 -07:00
zpencer bb0c0e53c2
core: perform channelz obj removal before things that may throw (#4235)
This way we won't risk an exception making us fail to clean up.
For transportClosed only remove if we know this isn't a
duplicate call to close.
2018-03-18 12:18:09 -07:00
zpencer ca99f80999
core,services: track server sockets in channelz (#4226)
Rather than querying the ServerImpl for its sockets, we register them
into channelz as with all the other entities, for consistency.

Error conditions are checked with `assert` statements, so we throw in
tests.
2018-03-16 17:21:25 -07:00
Benedikt Schmidt fd96cc2ddf alts: Use Guava base16 decoding functions in tests
The previously used javax.xml.bind.DatatypeConverter is deprecated in
Java 9.
2018-03-16 16:01:04 -07:00
Carl Mastrangelo 2ce1d370a0
core: re-add back in orphan wrapper 2018-03-16 14:51:38 -07:00
Carl Mastrangelo 7daefd75a1
core: make ManagedChannel honor Service config LB 2018-03-16 14:47:25 -07:00
zpencer 401726f310
services: update channelz TLS proto to use RFC names (#4233)
For context:
https://github.com/grpc/proposal/pull/71
2018-03-16 11:14:35 -07:00
Eric Gribkoff 5e8b8c2bee
cronet: delay cast to ExperimentalCronetEngine (#4230) 2018-03-15 19:09:19 -07:00
Carl Mastrangelo 37cd0427d0
services: fix lint warning 2018-03-15 10:51:06 -07:00
ZHANG Dapeng 26fc6324c4
core: fix typo in ClientCall.java javadoc 2018-03-15 10:07:30 -07:00
zpencer 9224d2ab8f
services: fix binary logging empty metadata NPE, add null checks (#4213)
Fix NPE and refactor tests to make it more obvious whether tests
assume empty or non empty metadata.

Add null checks to applicable places in binary log.
2018-03-14 11:29:49 -07:00
zpencer 2a778f126a
testing: temporarily disable socketStats_addresses test (#4216)
Hardcoding 127.0.0.1 leads to failure in ipv6
2018-03-13 18:42:11 -07:00
zpencer 4f19f1474f
buildscript: read jmh include class from project property (#4215)
The project property can be set form the CLI, so that it is simple to
run JMH on a single class.
2018-03-13 17:46:03 -07:00
Carl Mastrangelo 2761bbb851
core: handle long dns txt records properly, parse service config, add tests 2018-03-13 17:37:04 -07:00
ZHANG Dapeng 6b9e090d70
core: rm unnecessary InternalNameResolverProvider 2018-03-13 10:21:40 -07:00
Eric Anderson 9c5e96e376
buildscripts: Cleaner Linux release Docker
This is a greatly simplified Docker container compared to that in
compiler/. We really want the docker image to just be a build
environment, and build the specific versions of dependencies as part of
our normal build (not docker build).

It also includes a helper script that lets you easily do build actions
with the docker environment, but into a checkout on the host. This can
dramatically reduce the pain in building from the docker container as
the source doesn't need to be checked out and only caches are lost
between invocations.
2018-03-13 09:38:21 -07:00
Eric Anderson ab92ff0819 buildscripts: Use ErrorActionPreference=stop with powershell
Otherwise when an exception is thrown powershell will still exit with 0.
This is similar to set -e, except exceptions wouldn't have a status code
of their own.

Another option would have been -ErrorAction Stop, but this need to be
passed to each command inside the powershell script, so would be
functionally similar to our "|| exit" style in the .bat.
2018-03-13 09:16:59 -07:00
Eric Anderson 4bd4cf4ec1 buildscripts: check errorlevel of error-prone commands in .bat files
There's no 'set -e' in BAT, so we get to do it manually. Wee!

Note that we need to use 'exit /b' instead of 'exit' in the scripts, as
otherwise it exits more than just the current script.
2018-03-13 09:16:59 -07:00
Eric Anderson 11c8bcde1b Start 1.12.0 development cycle 2018-03-13 09:04:25 -07:00
ZHANG Dapeng 7852b34781
core: fix channel.getState(true) will not reconnect
resolves #4170
2018-03-12 14:13:52 -07:00
ZHANG Dapeng a83f67a706
core,netty,okhttp: Transparent retry
Changes:

- `ClientStreamListener.onClose(Status status, RpcProgress rpcProgress, Metadata trailers)` added.

- `AbstractClientStream.transportReportStatus(Status status, RpcProgress rpcProgress, boolean stopDelivery, Metadata trailers)` added

- `ClientCallImpl.ClientStreamListenerImpl` will ignore the arg `rpcProgress` (non retry)

- `RetriableStream.SubListener` will handle `rpcProgress` and decide if transparent retry.

- `NettyClientHandler` and `OkHttpClientTransport` will pass `RpcProgress.REFUSED` to client stream listener for later stream ids when received GOAWAY, or for stream received a RST_STREAM frame with REFUSED code.

- All other files are just a result of refactoring.
2018-03-12 14:12:46 -07:00