Commit Graph

1056 Commits

Author SHA1 Message Date
Eric Anderson ba8063e7b0 all: Prefer mock+delegatesTo() over Mockito.spy()
Spies are really magical and easily produce unexpected results. Using them in
tests can easily yield tests that don't do what you think they do. Delegation
is much safer when possible.

Delegation doesn't work when methods `return true`, final methods, and with
restricted visibility, though. So CensusModulesTest and
MaxConnectionIdleManagerTest are left as-is.
2018-01-11 09:32:54 -08:00
Eric Anderson af0283477d Update ErrorProne to 2.2.0 and fix failures 2018-01-10 14:14:27 -08:00
zpencer 16cec947c5
core: MethodDescriptor.toBuilder() should copy schemaDescriptor (#3941) 2018-01-10 13:15:25 -08:00
Eric Anderson 4bc0c95d0b Update ErrorProne to 2.1.3 and fix failures
The fixes could have subtle side-effects, but I did take care when making them.
2018-01-09 12:40:55 -08:00
Eric Anderson 35a6bf863d Enable the Guava Beta Checker 2018-01-08 14:52:51 -08:00
Spencer Fang 3809f676ee core: make TransportStats package-private
Limited access will be granted via InternalTransportStats.
2018-01-04 15:35:04 -08:00
ZHANG Dapeng 450a983552
core: rm unused variable and method 2018-01-02 10:06:10 -08:00
ZHANG Dapeng 66119463ad
core: fix java ErrorProne 2017-12-28 13:06:58 -08:00
zpencer e7b2089c85
core: ManagedChannel should not depend on internal (#3898) 2017-12-28 11:04:11 -08:00
ZHANG Dapeng 40453c744f
core: fix unimplemented API in ManageChannel
Two APIs were added to ManageChannel. This would be API breaking if they are still abstract.
2017-12-27 13:30:12 -08:00
Shohei Kamimori b1d62b70c4 core: remove unused variables 2017-12-20 10:27:16 -08:00
ZHANG Dapeng 2fe8ce23b2
core: retry support part 1 followup, channel.shutdown should not fail retry in backoff
As delayedTransport `shutdown` will make retry attempts that are in backoff unable to create new stream. So wrap delayedTransport with `retriableTransport`, which will keep uncommitted retriable streams alive when `shutdown`.
2017-12-20 10:24:28 -08:00
Carl Mastrangelo 172b2d36be
core: add a service config file 2017-12-19 12:33:27 -08:00
Carl Mastrangelo 6eaae5d081
core/grpclb: resolve TXT records in DNS name resolver and include balancer addresses 2017-12-19 10:01:53 -08:00
Kun Zhang 04420dfdf7
Start 1.10.0 development cycle (#3877) 2017-12-18 10:28:02 -08:00
zpencer 9358fc7233
core: BinaryLogProvider should not use ManagedChannelImpl class loader (#3874) 2017-12-18 10:26:26 -08:00
zpencer 39c266cbe7
core: introduce io.grpc.internal.BinaryLogProvider (#3872) 2017-12-17 16:47:33 -08:00
Eric Anderson 1bbe126b44 core: Use hard-coded string for version
Using META-INF for loading the version is broken on Android and
frequently broken when gRPC is shaded. Having hard-coded strings be
replaced on version bumps has been working well.

Fixes #2098
2017-12-15 15:31:26 -08:00
zpencer 7e655beb88
core: ManagedChannel should implement InternalInstrumented 2017-12-14 18:09:46 -08:00
zpencer 02f56b0218
core,services: move BinaryLog class to grpc-services (#3867) 2017-12-14 14:20:30 -08:00
zpencer f1151f91b9
core: InternalInstrumented<T> for instrumented classes (#3817)
Entities that report stats to channelz will implement this interface.
2017-12-13 12:56:25 -08:00
zpencer 5cb609f038
core: Add ChannelStats (#3752)
`ManagedChannelImpl` and `OobChannelq now both have a package
private field `ChannelStats`. There will be an internal access
API coming in a follow up PR.
2017-12-12 09:20:46 -08:00
Carl Mastrangelo 1bb9498ea1
core: fix Attributes value equality
Fixes: #3857
2017-12-11 18:12:49 -08:00
Eric Anderson 2ea77cce1e core: Avoid frequently computing inprocess useragent 2017-12-11 16:02:49 -08:00
jyane 11b5c1a7c1 core: support user-agent in InProcess 2017-12-11 15:26:29 -08:00
zpencer 2b3885bbc2
core,okhttp: add TransportTracer to okhttpclient (#3809) 2017-12-07 17:12:08 -08:00
Carl Mastrangelo 01ea67f5cf
core: move exception to listener for RuntimeException, Error still throws 2017-12-05 10:29:04 -08:00
Carl Mastrangelo c9b02db276
all: add Status messages to all statuses 2017-12-04 19:00:16 -08:00
ZHANG Dapeng 3d6fcfc752
core: retry support part 1 followup, drainedSubstreams should not contain closed ones 2017-12-01 12:50:04 -08:00
zpencer 9e7a4c44be
core: move WithLog and LogId to io.grpc (#3813)
The channelz service must not live in io.grpc.internal, and channelz
needs to be able to get the identifier of the entities it
tracks. Since io.grpc can not refer to io.grpc.internal, the LogId
must be moved out of internal.
2017-11-30 15:04:40 -08:00
ZHANG Dapeng bc54970128
core: retry support part 1, RetriableStream
With an approach using a variant of `DelayedStream` - `RetriableStream`.

`RetriableStream` is a logical stream per call that can create a sequence of `substreams`, the physical streams for the retry attempts. It could also create a family of substreams in parallel in hedging case.
 
`RetriableStream` buffers, delays and executes stream operations before `passThrough`, where `passThrough` is meant by `commit` as well as the buffer `drained` by the winning substream.

This PR only implements buffering messages and replaying buffered messages when retry.
Retry policy, hedging, transparent retry, backoff, max buffer size and APIs that users can enable retry are not included in this PR.
2017-11-30 14:21:39 -08:00
zpencer 25cd0be24c
core,netty,okhttp: move TransportTracer.Stats to io.grpc (#3812)
io.grpc can not refer to io.grpc.internal so this needs to be moved
out.
2017-11-30 13:01:58 -08:00
zpencer d42110c181
core: initial binary log class (#3699)
Each MethodDescriptor will have a binary log, though the log may
be a noop log. The binary log class is a skeleton class at the
moment, but does contain the max header and message length
info. The limits are determined by parsing the shell variable
GRPC_BINARY_LOG_CONFIG.
2017-11-28 12:20:03 -08:00
Eric Anderson e56d98723e core: Increase server handshake timeout to 120s
Previously it was 20s. 20s isn't _bad_, but may be too aggressive.
Having it longer doesn't hurt us too much; we just need some bound.
Since the MAX_BACKOFF on client-side is 120s, this will have client and
server match, except for jitter. Although I will note that the
client-side value covers more work than the server-side, such as
attempting to connect to multiple hosts.
2017-11-27 15:16:40 -08:00
Eric Gribkoff 4d35ea05c4
core,okhttp: handle unresolved proxy addresses 2017-11-23 11:00:09 -08:00
kenji yoshida 4db323c5c4 all: fix grammar typos in javadocs 2017-11-22 18:00:51 -08:00
Eric Anderson 2bde25d2d9 testing: Remove DeadlineSubject
The class is still used internally, so we move it to context's tests for
it to be reused. To avoid a circular dependency with context's tests
depending on core's tests, StaticTestingClassLoader was also moved to
context's tests.

This is driven by a need to modernize DeadlineSubject for newer versions
of Truth, but the newer versions of Truth update Guava. To avoid leaking
the Guava update to all users of grpc-testing, we're removing the
Subject. In our internal tests we can update the Truth dependency with
less issue.
2017-11-22 17:57:46 -08:00
David Cowden 3315d16f7c core: update ManagedChannel docs (#3762)
ManagedChannel now supports the getState/notifyWhenStateChanged API (#2292).
2017-11-17 13:14:42 -08:00
Eric Anderson 6bab82eeb6 auth: Use async version of getRequestMetadata
This avoids using DelayedStream and a thread hop when the credentials
are known immediately.
2017-11-17 11:52:07 -08:00
Eric Anderson 02817e2a9d
core: Stabilize ManagedChannelBuilder.overrideAuthority
The CallOptions from #1767 are not included, so this is not enough to resolve
the issue.
2017-11-17 07:23:35 -08:00
Eric Anderson da75b02c8f core: Stabilize HandlerRegistry
MutableHandlerRegistry from #933 is not stabilized, so this is not enough to
resolve the issue.
2017-11-17 07:16:52 -08:00
Eric Anderson f0dcbc3b03
core: Disable handshakeTimeout for InProcess
handshakeTimeout is unnecessary for InProcess, and the scheduling is causing
Thread creation that is breaking restrictive test environments. Those
environments are mostly broken already because client-side will try to create
Threads as well, but they are currently lucking out that the exception on
client-side doesn't break much.
2017-11-17 06:54:05 -08:00
Eric Gribkoff 667b0611fe
core: correct issue number for getSchemaDescriptor() 2017-11-16 14:39:14 -08:00
Eric Gribkoff 4c483ef7a0
core: workaround for Atomic*FieldUpdater bug on some Android devices 2017-11-16 09:59:47 -08:00
zpencer 2f155606b8
core,netty: add ID to NettyServer (#3745)
These are already WithLogId:
 ManagedChannelImpl, InternalSubchannel, ServerTransport
2017-11-15 11:49:13 -08:00
zpencer 47bee4feee
core,netty: plumb fake clock into transport tracer tests (#3724) 2017-11-13 15:58:29 -08:00
Kun Zhang ca9a41a46e
core: record RPC upstarts to Census. (#3708)
RPC upstarts are counted into metrics
RPC_{CLIENT,SERVER}_STARTED_COUNT. In addition, RPC completions are
counted into metrics RPC_{CLIENT,SERVER}_FINISHED_COUNT.  From these
metrics, users will be able to derive count of RPCs that are currently
active.
2017-11-10 17:22:22 -08:00
Eric Anderson bd32d6f599 bazel: Add dep on opencensus-contrib-grpc-metrics
This fixes the Bazel build after ef2ec949
2017-11-10 16:41:36 -08:00
zpencer d0a84ae5b8
core,netty: wire TransportTracer to netty client (#3705) 2017-11-10 15:55:21 -08:00
Eric Anderson 5a87a6fff6 stub: Improve threading expectation docs
This mainly copies documentation from other places, like StreamObserver
and ClientCall, but does fix some missing important threading notes.

Fixes #3413
2017-11-10 13:10:17 -08:00