Commit Graph

1161 Commits

Author SHA1 Message Date
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
Eric Anderson 5f0ee3a725
Bump to Guava 20
Fixes #4176
2018-03-23 15:45:05 -07:00
Eric Anderson 7eab0d9468 netty: Add support for Conscrypt 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
Eric Gribkoff 5337728fa7
core,netty: client sends rst stream when server half-closes (#4222) 2018-03-22 12:38:42 -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
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
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
ZHANG Dapeng 26fc6324c4
core: fix typo in ClientCall.java javadoc 2018-03-15 10:07:30 -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 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
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 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
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
zpencer f0eb6d2102
core,netty,okhttp,testing: nest TransportStats inside SocketStats for channelz (#4190)
Transport ststistics should really be a child member of SocketStats.
While we're at it, let's add the local and remote SocketAddress to
SocketStats, with a test.
2018-03-08 14:56:04 -08:00
Eric Anderson c59ddc52a1 core: Internal is not necessary for LoadBalancers
With the advent of LoadBalancer2 (now just LoadBalancer) the need to use
internal APIs was removed; there's now first-class APIs exposed for
LoadBalancer use.

The old LoadBalancer API interacted with io.grpc.internal.ClientTransport
directly.
2018-03-08 13:31:31 -08:00
Eric Anderson 19cd32fb66 core: Remove redundancy in JSON parser 2018-03-08 09:20:34 -08:00
Carl Mastrangelo 8b9d179798
core: split JSON parsing into its own file 2018-03-07 17:57:48 -08:00
Eric Gribkoff eef9add54c
core: rename prepareToLoseNetwork() to enterIdle() (#4179) 2018-03-07 15:51:13 -08:00
Eric Gribkoff ae1fb9467c
core: use exponential backoff for name resolution (#4105) 2018-03-05 21:46:02 -08:00
Eric Anderson 26719bdc5c Partially revert "core: change serverimpl,servercallimpl's internalclose to cancel stream (#4038)"
This partially reverts commit 48ca4527c1.
It leaves the changes to ServerCallImpl and test.

This also partially reverts "Lint fixes" commit
3002a23a0f which removed unused variables
which are now necessary again.

This is reverted for the combined result of two issues:
* Some users are testing that they get UNKNOWN when the service throws.
  That's not unreasonable given the behavior was well-publicised when it
  changed in v1.5. We should probably keep the UNKNOWN in some common
  cases (like the service threw immediately, before sending anything).
* The client could see CANCELLED instead of INTERNAL as had been
  intended. It's unclear as to why (I didn't investigate heavily). This
  behavior is visible in MoreInProcessTest and was overlooked during
  review.
2018-03-02 13:35:06 -08:00
Eric Anderson f865b31f5f core: Disable ManagedChannelImpl orphan check
Some internal tests are broken and noticing the warning logs. They need
to be fixed before this is enabled.
2018-03-02 12:29:33 -08:00
Eric Anderson e392af1efd Partially revert "core: Tracking NameResolverProvider being experimental"
This partially reverts commit c07ad68cbd.

The PARAMS_DEFAULT_PORT in NameResorverProvider is the preferred name.
The hope is still to kill NameResolver.Factory.
2018-03-02 12:29:08 -08:00
Eric Gribkoff 3268082f01
core: prefer getHostString() to getHostName() in ProxyDetectorImpl (#4165) 2018-03-02 12:11:54 -08:00
ZHANG Dapeng c07ad68cbd
core: Tracking NameResolverProvider being experimental 2018-03-01 14:20:49 -08:00
zpencer fcc8ea5950
core: load binarylog class using serviceprovider util (#4161)
Use the common util rather than rolling our own here.
2018-03-01 10:15:15 -08:00
Eric Anderson 3002a23a0f Lint fixes 2018-02-28 10:20:08 -08:00
Carl Mastrangelo 7af2373a03
core,netty,okhttp,alts,inprocess: deprecate usePlaintext(boolean) 2018-02-28 08:53:14 -08:00
Eric Anderson 1b5aadf068 core: Disable panic mode
It is now discovering legitimate errors in some tests that need to be
resolved first. Follow progress at #3293.
2018-02-27 14:03:34 -08:00
zpencer 09d305c3fc
core: add server transports to channelz (#4149)
A previous PR added client transports, this PR adds server
transports.
2018-02-27 10:02:44 -08:00
zpencer 4dc1b50e1a
core: add ServerImpl to channelz (#4147)
This allows servers to be identified by ids.
2018-02-27 08:22:25 -08:00
ZHANG Dapeng 39decadaf6
core: allow application to provide all threads - inprocess channel 2018-02-26 17:12:04 -08:00
zpencer 00d1805f78
core: register client transports to channelz (#4146)
This makes client side transports visible to channelz when created,
and removed when terminated.
2018-02-26 16:41:09 -08:00
Eric Anderson ce84c2b227 core: Add missing @RunWith test annotation (#4142)
For ManagedChannelOrphanWrapperTest
2018-02-26 14:06:43 -08:00
zpencer b71b1084de
core: register channels, subchannels, oobchannels with channelz (#4035)
Channels, subchannels and oobchannels are added at creation and
removed at termination. Same goes for subchannels and
oobchannels. Everything is registered as a hard reference. This means
channels that are not properly cleaned up using `awaitTermination`
will remain visible in channelz.
2018-02-26 09:45:19 -08:00
ZHANG Dapeng 4bac7d7084
core: add InProcessServerBuilder.generateName() 2018-02-23 16:44:10 -08:00
ZHANG Dapeng e31851a0eb
core: remove runDunTasks with filter
In `FakeClock` we have `runDueTasks()` (without filter), `numPendingTasks(filter)`, and `getPendingTasks(filter)` which are useful. The `runDueTasks(filter)` method seems not a right way to test.
2018-02-22 12:46:24 -08:00
zpencer 9dc4ded597
core: move ManagedChannelImpl orphan check to wrapper class (#4093)
okhttp and netty libraries will retain hard references to
ManagedChannelImpl via its non static nested classes. Moving the
orphan check to a wrapper class solves this problem.

- Added ForwardingManagedChannel + test
2018-02-22 11:57:26 -08:00