Commit Graph

3021 Commits

Author SHA1 Message Date
Kun Zhang ebbf8005be
doc: organize Attributes with annotations. (#4892)
* doc: organize Attributes Keys with annotations.

Keys are annotated with the following annotations:

1. Grpc.TransportAttr: transport attributes returned by
{Client,Server}Call.getAttributes().

2. NameResolver.ResolutionResultAttr: attributes passed as the
argument of NameResolver.Listener.onAddresses() and
LoadBalancer.handleResolvedAddressGroups()

3. EquivalentAddressGroup.Attr: attributes from
EquivalentAddressGroups.

* Expand the usage of annotations to Attributes variables.
2018-10-01 10:11:01 -07:00
Carl Mastrangelo 93ead9d666
protobuf: make extension registry method experimental 2018-09-28 17:18:28 -07:00
zpencer 2fae9a3a97
core: permanently store authority at channel creation (#4886)
Getting the authority must not rely on the name resolver being
non-null, because that can trivially happen if the channel is shut
down.
2018-09-28 16:10:14 -07:00
Jesse Wilson 8b16899bc1 Upgrade to Guava 26.0-android and jsr305 3.0.2 2018-09-28 13:23:55 -07:00
Eric Anderson 1f006959b0 github/lock.yml: Lock GitHub issues after 90 days
The earlier year was just for testing. Things are working as we'd hope.
Choosing 90 days for now. If an issue is closed at the beginning of a
release cycle, that gives release cycle + 6 weeks to upgrade, which
seems plenty. Worst-case, is users open a new issue referencing the old
one they found.
2018-09-28 09:48:13 -07:00
Jiangtao Li 8e72351a65
alts: plumb authority to ALTS protocol negotiator (#4880)
alts: plumb authority to ALTS protocol negotiator
2018-09-27 19:27:45 -07:00
zpencer da87ffb329
core,services: v1 binlog (#4846)
Log using new proto definition

- Remove io.grpc.BinaryLog.CallId because a call ID is now an AtomicLong
- Add the concept of "always included" and "never included" metadata
  keys. This is needed because grpc-status-details-bin is already
  logged in the binlog msg, and we will log grpc-trace-bin for the
  census info.
- unit tests are effectively rewritten
2018-09-27 13:19:24 -07:00
Eric Anderson 69bb8a37f8 RELEASING.md: Add missing TestDeprecatedService replacements 2018-09-25 12:32:10 -07:00
Carl Mastrangelo 32bb5ba156
protobuf: expose ExtensionRegistry setter 2018-09-25 10:49:43 -07:00
Carl Mastrangelo 5e4d9a591e
okhttp: include better ALPN error message and fine log some exceptions 2018-09-24 18:36:07 -07:00
Eric Anderson 693779dba7
alts: Remove usage of TransportCreationParamsFilterFactory
Provide a ProtocolNegotiatorFactory instead.
TransportCreationParamsFilterFactory is being removed.
2018-09-24 17:32:04 -07:00
Eric Anderson acf80d63b0
netty: Allow specifying ProtocolNegotatiorFactory directly to Channels
This will be the replacement for TransportCreationParamsFilterFactory
and matches somewhat what used to be done and what is done on
server-side.
2018-09-24 16:09:36 -07:00
Carl Mastrangelo 70b1b1696a
android-interop-testing: fix Java7 compilation failure 2018-09-22 01:38:30 -07:00
Eric Anderson 2653cf4d6b github/lock: Use reason "resolved", which is the default
What the "reason" means was explained in
https://github.com/grpc/grpc-java/pull/4862#issuecomment-423662264 , and
it's probably fair to accept the default.
2018-09-21 16:32:53 -07:00
zpencer ed70594294
services: disallow duplicate rules for a binlogging services or methods (#4868)
Let's simplify the impementation to just disallow duplicates. This
makes it easier to maintain.

Background info: https://github.com/grpc/proposal/pull/104
2018-09-21 15:59:37 -07:00
Eric Anderson be04325a6a github/lock: Override some of the defaults before enabling
These are settings for the Lock app: https://github.com/apps/lock

We'll probably want to reduce the daysUntilLock to something lower, but
want to try it out first and a larger value will impact fewer issues.
365 is the default, but making it clear what setting we are using.

I disable the comment because I don't want notification noise. I disable
the resolved feature because I'm not quite sure what it is and I'm not
really looking for anything fancy.

The defaults can be found at
https://github.com/dessant/lock-threads/blob/master/src/schema.js
2018-09-21 11:14:37 -07:00
Eric Anderson 80883f0983 buildscripts: Reduce verbosity of protobuf builds
A substantial portion of our build logs are just compiling protobuf.
This reduces the noise while still keeping most of the useful
information.
2018-09-21 10:58:07 -07:00
Spencer Fang cc09eab9af core: fix channelz import on AutoConfiguredLoadBalancerFactory
The original PR was stale when merged.
2018-09-19 14:32:16 -07:00
ZHANG Dapeng 0afc10c2d6
core: channel tracing to log lb policy changes 2018-09-19 11:36:33 -07:00
Eric Anderson 6f71472cf4 alts: Initialize ProtocolNegotiators eagerly
This simplifies the construction process, as we have fewer "interesting"
phases to weed through.
2018-09-17 16:49:56 -07:00
Carl Mastrangelo b0f423295b
all: use Java7 brackets 2018-09-14 13:52:29 -07:00
Carl Mastrangelo 6cf849a7ce
services: fix duration in Binlog test 2018-09-12 17:16:52 -07:00
Nick Hill ed709ff9ff core: remove redundant SubchannelPicker refreshes in RoundRobinLoadBalancer
* Remove redundant SubchannelPicker refreshes in RoundRobinLoadBalancer

- Ensure active subchannel list and round-robin index is only
regenerated/refreshed when it changes
- Make it so that Subchannels exist in subchannels map iff their state
!= SHUTDOWN
- Add EmptyPicker class since logic for this case is disjoint from the
non-empty case

* remove explicit initialization of boolean ready field

per @carl-mastrangelo's review comment

* minor restructuring to make logic clearer; more explanatory comments

* move some checks inside updateBalancingState method for clarity

* store current state and picker in RRLB, only update when new one is diff

* some more simplification/refactoring; improve test coverage

- remove now redundant check in handleSubchannelState

- collapse getAggregatedState() and getAggregatedError() into
handleBalancingState()

- have both pickers extend new RoundRobinPicker, move
areEquivalentPickers() logic into RoundRobinPicker.isEquivalentTo()

- extend unit tests to cover some additional cases

* Address latest review comments from @zhangkun83

- Use explicit check for non-empty list instead of assert
- Change EmptyPicker.status to be non-nullable
- Further test coverage improvement including explicit picker comparison
tests

* use EMPTY_OK instead of Status.OK for initial empty picker
2018-09-12 15:06:46 -07:00
ZHANG Dapeng 7270938ebf
export CL: Fix misspelling. 2018-09-12 13:30:52 -07:00
Eric Anderson 7efbc36c72 netty: Initialize ProtocolNegotiators eagerly
This simplifies the construction paradigm and leads to the eventual
removal of TransportCreationParamsFilterFactory. The eventual end goal
is to be able to shut down ProtocolNegotiators as is necessary for ALTS.

The only reason the initialization was delayed was for 'authority', so
we now plumb the authority through GrpcHttp2ConnectionHandler.
2018-09-12 08:16:54 -07:00
ZHANG Dapeng c8975e987b
all: fix lint warnings in import 2018-09-11 16:24:44 -07:00
Kun Zhang 337b78cd34
Update README to reference 1.15.0 (#4847) 2018-09-11 15:01:48 -07:00
zpencer 8fc84daa30
services: remove RequireDoubleSubmitCookieInterceptor (#4833)
The CSRF protection has been moved to the proxy implementation. This
is cleaner since the gRPC service should not need to know about
grpc-web.
2018-09-10 18:06:26 -07:00
Eric Anderson 98630f1870 netty,okhttp: Enable TransportTest.flowControlPushBack
It appears to be stable now. Ran for 1000s of times. I do see some
general flakiness in TransportTest, but it applies to the tests in
general and isn't specific to this one test. It is:

```
org.mockito.exceptions.verification.WantedButNotInvoked:
Wanted but not invoked:
listener.transportReady();
-> at io.grpc.internal.testing.AbstractTransportTest.startTransport(AbstractTransportTest.java:1815)
Actually, there were zero interactions with this mock.
```

This flake is not seen often because it occurs less frequently when
running all the tests (~.1% vs 1%). One of the early tests must warm
something up to make it less likely.
2018-09-10 17:45:20 -07:00
Eric Anderson 1da3133fdf testing: Fix flake in AbstractTransportTest.flowControlPushBack
This attempts to fix a flake seen exactly once with the
currently-disabled OkHttpTransportTest.flowControlPushBack:
```
java.lang.AssertionError
	at org.junit.Assert.fail(Assert.java:86)
	at org.junit.Assert.assertTrue(Assert.java:41)
	at org.junit.Assert.assertTrue(Assert.java:52)
	at io.grpc.internal.testing.AbstractTransportTest.flowControlPushBack(AbstractTransportTest.java:1300)
```

That was a failure for assertTrue(serverStream.isReady()), because the
awaitOnReady was finding the previous invocation of onReady. We now
track how many times it has been called. This was a bug introduced in
a8db154702 but wouldn't have been noticed since the in-process transport
is deterministic.
2018-09-10 17:45:20 -07:00
zpencer 95fd47d747
core, services: remove census from binary logs (#4845)
The exact census span behavior wrt gRPC is not yet defined, so let's
punt on tight integration.

It may be fine to log grpc-trace-bin on server side because it is a
key visible to the application.
2018-09-10 16:35:08 -07:00
Kun Zhang e1c6cadb50
grpclb: more useful debug logs. (#4831)
The addresses from the string dump of the LoadBalanceResponse proto is
in binary format and not human-readable.  We will log the
BackendAddressGroups when using a new list from the balancer.  The
original logging of LoadBalanceResponse is downgraded to FINER level.
2018-09-07 09:44:10 -07:00
creamsoup 189991012b
core: DnsNameResolver caches refresh (#4812)
DnsNameResolver caches refresh using java security property networkaddress.cache.ttl.

Resolves #4745
2018-09-06 16:58:34 -07:00
Eric Gribkoff d2c0653b2e interop-testing: add very_large_request case to test client (#4816)
interop-testing: add very_large_request case to test client
2018-09-06 16:01:35 -07:00
creamsoup 554210da2a
okhttp: settings acks back after apply settings before sending any data (#4825)
okhttp: setting acks back after apply settings before sending any data as a result of the change.
Resolves #4809 also, make #4816 the not flaky.
2018-09-06 15:52:02 -07:00
zpencer 2fca42feb9
all: prepend internal classes with Internal (#4826)
This is a safer way to hide the classes, because they will not appear
in public targets for some build configurations.
2018-09-05 18:48:42 -07:00
creamsoup 1b6adaff61
Revert "examples: Add google mirrored maven central to examples pom.xml to deflake kokoro." (#4821)
Revert "examples: Add google mirrored maven central to examples pom.xml to deflake kokoro. (#4813)"

This reverts commit 54f76dfeaf.
2018-09-04 19:23:46 -07:00
zpencer 4d366ce978
all: move Channelz to io.grpc as InternalChannelz (#4797)
This is an API used to coordinate across packages and must live in
`io.grpc`.

Prepending `Internal` makes it easier to detect and hide this class
from public visibility when using certain build tools.

fixes #4796
2018-09-04 16:52:01 -07:00
Kun Zhang f8274c4e7c
doc: update README because we have been requiring Java 7. (#4819) 2018-09-04 11:09:09 -07:00
creamsoup bbacd164f9
skip populating trace header if no census impl is available. (#4805) 2018-08-30 14:45:11 -07:00
ZHANG Dapeng d7ce74f83d
benchmarks: fix nano time comparison 2018-08-30 11:48:38 -07:00
creamsoup 54f76dfeaf
examples: Add google mirrored maven central to examples pom.xml to deflake kokoro. (#4813)
Add google mirrored maven central to examples pom.xml to deflake kokoro.
2018-08-29 19:02:47 -07:00
Eric Gribkoff f93695ac70
android-interop-testing: correct order in assertEquals (#4810) 2018-08-29 13:28:02 -07:00
ZHANG Dapeng a18abfbf9f
stub: stablize AbstractStub.withExecutor API
Resolves #3605
2018-08-29 11:58:13 -07:00
Jiangtao Li 433ac00de4
alts: convert handshaker service channel to SharedResourceHolder (#4802)
alts: convert handshaker service channel to SharedResourceHolder
2018-08-29 10:09:09 -07:00
Jiangtao Li 87513d8e83
alts: if ALTS is not running on GCP, fails call (#4807)
alts: if ALTS is not running on GCP, fails call rather than RuntimeException
2018-08-29 08:59:16 -07:00
Eric Gribkoff fd73209e0c
cronet: report statsTraceCtx.clientOutboundHeaders() (#4768) 2018-08-28 20:19:45 -07:00
ZHANG Dapeng 6037659dd7
core: make HedgingPolicy final
Just as RetryPolicy is final.
2018-08-28 17:09:05 -07:00
Eric Gribkoff 03dab29e3a
buildscripts: run Android interop tests on Firebase (#4314) 2018-08-28 14:56:06 -07:00
Eric Gribkoff d3cdfd0883
okhttp: use java 7, avoid compiler varargs warning (#4806) 2018-08-28 11:53:15 -07:00