Commit Graph

380 Commits

Author SHA1 Message Date
ZHANG Dapeng 8062406afc
interop-testing,core: interop test to get remote address attributes
Adding interop-test for getting remote server address from client interceptor. Also added this feature to inprocess transport.
2019-12-02 13:30:55 -08:00
Jihun Cho 7db873f1f6
Roll-forward of stub,compiler: generated stub extends Abstract{Async,Future,Blocking}Stub #6196 (#6458)
This reverts commit 2eb3f8c34e (#6317).
2019-11-25 09:41:16 -08:00
Carl Mastrangelo 40bcab5d12 core: use seconds in deadline exceeded string (#6341) 2019-11-05 13:59:20 -08:00
Jihun Cho 296440a4db interop-testing,benchmarks: publish tar, zip 2019-10-31 17:12:30 -07:00
Jihun Cho 2eb3f8c34e
stub,compiler: Rollback Abstract{Future,Blocking,Async}Stub (#6317)
rollback of #6304 & #6196
2019-10-22 13:27:30 -07:00
Jihun Cho 45d49a56cc
stub,compiler: generated stub extends Abstract{Async,Future,Blocking}Stub (#6196) 2019-10-17 14:49:24 -07:00
Jihun Cho e9ac1b4a76
all: update modules to wait until other module's sourceSet is available (#6232) 2019-10-02 15:05:44 -07:00
Carl Mastrangelo ab2aff48dc netty,okhttp,cronet: add option to use get/put when methods are safe/idempotent
This change adds two booleans to the ChannelBuilders to
allow transports to use get and put.   These are currently defaulted to
on, but unset on the method descriptors.   This change is 1/2 that will
allow the safe / idempotent bits to be set on generated proto code.
Part 2/2 will actually enable it.

The use case for this is for interceptors that implement caching logic.
They need to be able to access the safe/idempotent bits on the MD in
order to decide to how to handle the request, even if gRPC doesn't use
GET / PUT HTTP methods.
2019-09-25 14:57:17 -07:00
Eric Anderson 4215b80b81 Apply java plugin explicitly when needed 2019-09-13 09:42:17 -07:00
Eric Anderson 3b29f74271 Move ALPN Agent configuration to each project needing it 2019-09-13 09:42:17 -07:00
Eric Anderson 5b838e5284 Apply maven-publish plugin explicitly when needed 2019-09-13 09:42:17 -07:00
Eric Anderson 3c3a823a81 Swap to Gradle's Plugin DSL for much of build
Examples and android projects were left unchanged. They can be changed
later.

No plugin versions were changed, to make this as non-functional of a
change as possible. Upgrading Gradle to 5.6 was necessary for
pluginManagement in settings.gradle.
2019-09-13 09:42:17 -07:00
Igor Bernstein 271cbff1b8 core: Migrate to new OpenCensus method & status tags (#5996)
Fixes #5593 and supersedes #5601

Now that https://github.com/census-instrumentation/opencensus-java/pull/1854 has been merged & released as 0.21.0. We can start using the method & status tags.

Background:
Opencensus introduced new tags for status and method (https://github.com/census-instrumentation/opencensus-java/pull/1115). The old views that used those tags were deprecated and new views were created that used the new tags. However grpc-java wasn't updated to use the new tags due to concern of breaking existing metrics. This resulted in the old views being deprecated while the new views were broken (goomics #50).

https://github.com/census-instrumentation/opencensus-java/pull/1854 added a compatibility layer to opencensus that would remap new tags to old tags for old views. This should unblock grpc to switching to the new tags while allowing old views to still be populated. That commit was released as part of opencensus 0.21, which grpc currently uses
2019-08-01 10:37:04 -07:00
Jihun Cho 65109e6738
netty: Netty{Server,Channel}Builder requires all or none of ELG and ChannelType (#6014) 2019-07-26 09:25:02 -07:00
liym 47b11ab7a1 compiler: Use 'SERVICE_NAME' instead of duplicated '$Package$$service… (#5943)
* compiler: Use 'SERVICE_NAME' instead of duplicated '$Package$$service_name$'

* compiler: Align indentation

* Fix typo

* Add modified golden files and all re-generated code to meet Travis CI and Windows build requirements

See PR #5943

* Polishing
2019-07-24 10:37:13 -07:00
Carl Mastrangelo cc524f10d3
netty,interop-testing: increase timeouts on tests for TSAN 2019-07-19 15:24:19 -07:00
Carl Mastrangelo c3d7d74175
interop-testing: fix race in CascadingTest
ServerCall.close() is meant to only be accessed from a single thread, but in the test it is accessed from the callbacks of several client calls.  Synchronize access to sate TSAN.
2019-07-15 11:17:54 -07:00
Carl Mastrangelo d5e1a4bb5d
interop-testing: support just ServerBuilder types 2019-06-26 16:47:17 -07:00
Kun Zhang ddbaf743cc
core: attach debug information about stream to DEADLINE_EXCEEDED (#5892)
Works for #4740 

- Subclasses of `AbstractClientStream` include remote address in insight if available.
- `DelayedStream` adds buffered time, and the insight of real stream if it's set.
- `RetriableStream` insights outputs of Substreams.

Example error message:
```
deadline exceeded after 8112071ns. [buffered_nanos=24763, remote_addr=foo.test.google.fr/127.0.0.1:44749]
```
or
```
deadline exceeded after 8112071ns. [buffered_nanos=22344324763, waiting_for_connection]
```

This is related to #4776 but taking a more usage-specific approach.
2019-06-19 17:30:44 -07:00
Eric Anderson 675b37a027 Revert "interop-testing: Observe flow control in TestServiceImpl"
This reverts commit e795f14bed. It breaks some of
our internal tests. At the very least the cast fails because we are reusing the
service for something without going through the normal stub. There may also
have been a test hang, but it'd take more effort to figure out.
2019-06-14 15:17:22 -07:00
Eric Anderson e795f14bed interop-testing: Observe flow control in TestServiceImpl 2019-06-14 09:01:29 -07:00
Carl Mastrangelo 44ecdf3649
interop-testing: fix tests on Android 2019-06-07 15:01:21 -07:00
Eric Anderson ee5731cc18 interop-testing: Only set okhttp's sslSocketFactory for test CA
We want the interop client to be configured like a normal user would,
and a normal user wouldn't call sslSocketFactory to use the default
roots.
2019-06-06 10:30:10 -07:00
Carl Mastrangelo 9ef0e9fc1b
interop-testing: disable timeout when debugging 2019-06-05 23:39:43 -07:00
Kun Zhang 276b7d8512
interop-testing: create GrpclbLongLivedAffinityTestClient (#5817)
This is a long-running stand-alone test client for a specific customer that uses GRPCLB's pick_first mode.
2019-05-31 12:54:05 -07:00
Tim van der Lippe ad0893737e Migrate org.mockito.Matchers#any* to org.mockito.ArgumentMatchers
The former is deprecated and replaced by the latter in Mockito 2.
However, there is a functional difference: ArgumentMatchers will reject
`null` and check the type if the matcher specified a type (e.g.
`any(Class)` or `anyInt()`). `any()` will remain to accept anything.
2019-05-29 16:53:01 -07:00
Yang Song 46f34a513f core: Make OpenCensus tags non-propagating. (#5689)
The `method` and `status` shouldn't be propagated in the first place,
but in previous OpenCensus implementation all tags are propagating by
default. Now with the TagMetadata it may make sense to change them to
local tags.

This will be a breaking change to users who depend on the behavior that
these tags propagate through process boundaries.
2019-05-24 14:32:26 -07:00
Yang Song ea4e2bffec all: Upgrade OpenCensus versions. (#5657)
Also updated CensusModule to use the new helper methods ContextUtils.withValue() instead of directly manipulating the context keys. See census-instrumentation/opencensus-java#1864.
2019-05-08 16:05:37 -07:00
Carl Mastrangelo 0c304b1863
interop-testing: remove Truth method named() 2019-04-24 16:05:08 -07:00
Kun Zhang ba335f5e68
interop-test: add test case for "pick_first" picking behavior (#5554)
New fields are added to the test protos according to grpc/grpc-proto#51

This test needs to be run in an environment where "pick_first" or "grpclb" with child policy "pick_first" is configured.
2019-04-10 14:08:54 -07:00
ZHANG Dapeng 40526086eb
interopt-testing: move mockito from compile to testCompile (#5541)
Resolves #5540
2019-04-03 14:09:03 -07:00
apolcyn 1eb6fc523e interop-testing: implement compute engine channel creds test case in Java 2019-03-21 10:34:51 -07:00
Tim van der Lippe d35fbd7eee all: Update to Mockito 2
This is the public port of cl/238445847

Fixes #5319
2019-03-19 14:17:52 -07:00
Jiangtao Li 185cf3d047
alts: add ComputeEngineChannelBuilder to interop test (#5475)
* alts: add ComputeEngineChannelBuilder to interop test

* alts: rename to compute_engine_channel_creds
2019-03-13 18:50:08 -07:00
Eric Anderson b48b0ac1d4 all: Stop committing generated protobuf messages
This commit swaps to using a Sync task to place generated code in the
src/generated folder instead of the gradle-protobuf-plugin's
generatedFilesBaseDir. This provides much nicer results on failed
builds, and you will no longer see all the generated files deleted.

But at the same time the Sync task makes it easy to only copy the
grpc-generated code. This was not previously done because we were lazy
and using generatedFilesBaseDir, which made it difficult to treat the
services differently from the messages.
2019-03-05 16:28:55 -07:00
Kun Zhang 83b92cfc9f
core: pass transport attributes to ClientStreamTracer.Factory.newClientStreamTracer() (#5380)
This will be a new override.  The old override is now deprecated.

In order to pass new information without adding new overrides, I shoved most information
into an object called StreamInfo.  The Metadata is left out to draw attention because
it's mutable.

Motivation: this is needed for correctly supporting pick_first in GRPCLB.  GRPCLB needs to
add a token to the headers, and the token varies among servers.  With round_robin, GRPCLB
create a Subchannel for each server, thus can attach the token when the Subchannel is picked.
To implement pick_first, all server addresses will be put in a single Subchannel, we will
need to add the header in newClientStreamTracer(), by looking up the server address from
the transport attributes and deciding which token to add.
2019-02-21 11:13:51 -08:00
Eric Anderson eaca73473c
Upgrade to protobuf 3.6.1
For Bazel, we upgrade to protobuf 3.6.1.2 and javalite HEAD to fix
incompatibilities in newer Bazel releases.

compiler/Dockerfile is unused, so it was removed instead of being updated.

protoc no longer includes codegen for nano, so we remain on the older protoc
any time nano is used.

Protobuf now requires C++11 when compiling, so windows was swapped to
VC 14.
2019-02-07 13:40:53 -08:00
Carl Mastrangelo f6ec07d87d
core,netty: expose listening on multiple ports 2019-02-06 15:49:59 -08:00
Carl Mastrangelo 3a39b81cf5
all: remove java6 type args 2019-02-04 10:03:50 -08:00
ZHANG Dapeng 0dbab26bb4
all: fix lint 2019-02-01 17:06:27 -08:00
apolcyn 574c053ebb interop-testing: Add GoogleDefaultCreds test case for java 2019-02-01 16:49:54 -08:00
Eric Anderson 473a7d1ce7
interop-testing: Simply ProxyTest and shutdown handling 2019-01-30 16:23:26 -08:00
Eric Anderson c2f8d83663
gae-interop-testing: Remove jdk7 test
GAE Java 7 is dead as of January 16.
https://cloud.google.com/appengine/docs/deprecations/java7
2019-01-24 08:54:47 -08:00
Carl Mastrangelo d7659411eb
interop-testing: deflake MoreInProcessTest 2019-01-22 18:00:14 -08:00
Jihun Cho 08efd978d7
all: remove duplicated dependency (#5207) 2019-01-03 10:50:44 -08:00
Eric Anderson 330f45a2cd interop-testing: Disable flaky ProxyTest.smallLatency
Fixing the flakiness is tracked in #2951. The current flakiness is ~3/8
fail.
2018-12-14 16:01:39 -08:00
Thomas Broyer 2ffc46d6fa Update net.ltgt.errorprone to 0.6 and enable Error Prone on JDK 10+ 2018-12-13 10:17:06 -08:00
Eric Anderson 219c486d4e interop-testing: Sample to reduce ProxyTest flakiness
This also reduces the time of the bandwidth tests from ~6 seconds to ~2,
each (they have about 1s of overhead).

Fixes #2951. The flake is very frequent in #4980.
2018-12-13 10:02:18 -08:00
Eric Anderson de9bc0bcf1 Specify Locale to toLowerCase and lint fixes 2018-12-06 17:15:48 -08:00
Arnout Engelen 3dab7aed2f netty: Client-side support for h2c via Upgrade
Fixes #4518
2018-11-30 18:10:27 -06:00