Commit Graph

2642 Commits

Author SHA1 Message Date
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
Eric Gribkoff c6fe4deb33
core: set delayedTransport picker to null in idle mode (#4207) 2018-03-12 12:21:39 -07:00
zpencer 402c1740fa
core,okhttp,netty,alts,testing: Plumb proxy resolved addr to transports (#4137)
ProxyDetector is now responsible for resolving the proxy's
`InetSocketAddress`, and `ProxyParameters` asserts that the address is
resolved. The results are plumbed through using a `PairSocketAddress`,
which is a special `SocketAddress`.

If a proxy should be used but the proxy can not be resolved, we the
`DnsNameResolver` will re-attempt the resolution later.

Remove the unit test testing for unresolved proxy addresses, since
it's no longer applicable.
2018-03-12 11:15:40 -07:00
Paul Jensen 2fc2270011 cronet: add API to apply TrafficStats tag and UID to Cronet GRPC channels (#4208) 2018-03-12 10:05:25 -07:00
zpencer f56ac76b35
core,services: add ChannelzService class (#4205)
This implements the methods to expose the stats as a gRPC
service. GetServerSockets is still unimplemented and will require a
follow up change.
2018-03-10 14:58:34 -08:00
zpencer 0678499965
core: express children of channels as WithLogId for channelz (#4201)
For channelz ref objects, we need the id as well as the name. By
returning a `WithLogId`, we can return the original object so that we
may call `toString` on it.
2018-03-09 15:49:15 -08:00
zpencer f017a0657c
services: update channelz.proto to refer to sockets as socket_ref (#4203)
This is more consistent with the other fields.
2018-03-09 14:50:37 -08:00
zpencer c3c8bc7ab6
core: keep root channels separate from subchannels in channelz (#4200)
It is a channelz requirement that subchannels and channels are
separate, and we can not retrieve a root channel by asking for a
subchannel and vice versa.
2018-03-09 14:44:41 -08:00
Eric Anderson 1fb72ef6c1 Ignore proto-generated code for ErrorProne
Previously if protobuf-generated code triggered ErrorProne we'd have to disable
the failing check for all code in that task. With -XepExcludedPaths we can
disable the ErrorProne-checking just for protobuf. Note that we continue using
ErrorProne on our generated code. Also note this only applies to ErrorProne
checks; JDK checks still require task-level disabling.
2018-03-09 11:19:20 -08:00
Eric Gribkoff 7fd22080e9
buildscripts: avoid unbound variable error (#4197) 2018-03-09 09:18:58 -08:00
Eric Gribkoff 4369e8cd9a
buildscripts: add Kokoro-based CI for Android APK stats (#3984) 2018-03-08 18:41:39 -08:00
zpencer 921b668ad5
core,netty,okhttp,testing: separate local vs remote stream start times for channelz (#4194)
The channelz spec states that the two must be separate.
2018-03-08 16:57:12 -08:00