Commit Graph

3660 Commits

Author SHA1 Message Date
Chengyuan Zhang e68e4004e4
cronet: move call options APIs into an internal accessor class (#6073)
* cronet: move call options APIs into an internal accessor class

* Removed deprecated call option key.
2019-08-16 01:05:32 -07:00
Carl Mastrangelo 4c1e197fcd
okhttp: remove unused import 2019-08-15 16:00:02 -07:00
Chengyuan Zhang c521a31886
android: fix Javadoc symbol/class not found errors (#6063)
* android: fix Javadoc symbol/class not found errors

* Removed redundant join, files API can already handle list.

* Replace usage of javaCompile with javaCompileProvider

* Avoid afterEvaluate by filling javadocs.classpath in android configuration.

* Construct FileCollection via files(Closure), which delays the file resolution.
2019-08-15 12:47:14 -07:00
Carl Mastrangelo 21c34d7862
netty: check for null protocol negotiator in NettyChannelBuilder 2019-08-15 11:11:31 -07:00
Chengyuan Zhang ad47eee4d3
okhttp: add PerfMark tracing for okhttp transport (#6038)
* okhttp: add PerfMark tracing for okhttp transport

* change task for AsyncSink to give more accurate task description

* add final to field tag

* add PerfMark dependency in okhttp package bazel
2019-08-14 17:20:29 -07:00
Jannis Andrija Schnitzer 93898734c2 bazel: Fix java path separator bug on Windows (#6054) 2019-08-14 14:28:31 -07:00
Eric Anderson 6c7258b05e Upgrade gradle-errorprone-plugin to 0.8.1
This fixes the following warning when building grpc-android:
WARNING: API 'variant.getJavaCompiler()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getJavaCompiler(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
2019-08-14 16:22:59 -05:00
Carl Mastrangelo 458f4533db
netty: migrate Server protocol negotiation to new style
* Revert "Revert "netty: change server to new protocol negotiator model" (#5798)"

This reverts commit 4e5e19f6fd.
2019-08-14 13:00:42 -07:00
ZHANG Dapeng ce53d0eac7
Update README etc to reference 1.23.0 2019-08-13 17:46:50 -07:00
Eric Anderson 9fcfb5b4f8
netty: Limit number of frames client can cause server to enqueue
Http2ControlFrameLimitEncoder is from Netty. It is copied here as a
temporary measure until we upgrade to the version of Netty that includes
the class.

See CVE-2019-9515
2019-08-13 12:24:15 -05:00
Dharmesh Jogadia 5790503d79 core,okhttp: removed GrpcUtil.IS_RESTRICTED_APPENGINE and dependent code (#6051) 2019-08-13 10:11:56 -07:00
ZHANG Dapeng 1949ebd7ef
grpclb: shuffle pick first index
Each new instance of GrpcLbBalancer will have a different pick first index.
2019-08-12 17:07:23 -07:00
Chengyuan Zhang d2307139c8
cronet: do not expose setTrafficStats* as public APIs (#6055) 2019-08-12 14:42:18 -07:00
Laurent Le Brun 503696aa9a bazel: Remove missing pattern from glob
There's no third_party directory.
This change makes the repository compatible with
Bazel change --incompatible_disallow_empty_glob.
2019-08-08 16:41:17 -07:00
Chengyuan Zhang 539f0400b6
core: handle removing partially-closed resources for throwing on close. Fixes #6002. (#6044) 2019-08-08 14:23:59 -07:00
Chengyuan Zhang c5317e4935
xds: do not add a new CallMetricRecorder instance to context if there is already one (#6042)
* xds: do not add a new CallMetricRecorder instance to context if there is already one

* save a local reference to CallMetricRecorder instance to allow ServerCall#close() being called in a different context

* added test coverage for having ServerInterceptor/ServerStreamTracerFactory both install CallMetricRecorder
2019-08-08 13:00:46 -07:00
Jihun Cho 4faad27078
netty: record ByteBuf access in Netty{Client,Server}Stream before calling MessageDeframer (#6027) 2019-08-02 16:25:08 -07:00
Kun Zhang 4e4d4d8ab5
core: allow setting custom Deadline.Ticker to InProcessServerBuilder (#6034)
ServerImpl uses that ticker to create incoming Deadlines. This feature is specifically restricted to in-process, as it can also customize ScheduledExecutorService, and them together can fake out the clock which is useful in tests. On the other hand, a fake Ticker won't work with Netty's ScheduledExecutorService.

Also improved mismatch detection, documentation and tests in Deadline.
2019-08-01 13:13:20 -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
Chengyuan Zhang b8933faae1
services: added even more (context-related) test cases for CallMetricRecorder (#6033) 2019-08-01 10:09:26 -07:00
Kun Zhang f9509694b9
context: allow creating Deadline with custom Ticker. (#6031)
This makes Deadline more test-friendly. Next step is to allow
ServerBuilder to take a custom Ticker and use it for creating
incoming Deadlines. With both changes in, application logic will be
able to verify the Deadlines they set.
2019-07-31 11:26:51 -07:00
ZHANG Dapeng e14f8de4ab
Start 1.24.0 development cycle 2019-07-31 11:03:13 -07:00
ZHANG Dapeng 79bc50c171
doc: fix version bug in documentation/android-channel-builder.md 2019-07-30 15:36:33 -07:00
Jean de Klerk 188b4d1e51 compiler: add note about where to download precompiled version of plugin (#6022) 2019-07-29 17:08:03 -07:00
Chengyuan Zhang 99993bee13
xds: implement a server interceptor for taking server application metrics and sending to client side in ORCA format (#6018)
* Added methods in CallMetricRecorder accessor for accessing context key and creating new CallMetricRecorder instance.

* Added impl for a server interceptor that records and sends custom metric values to client side.

* Added unit test for the server interceptor.

* Modified dependencies to have xds package depends on grpc-services (for CallMetricRecorder) and grpc-testing-proto (for testing proto).

* Changed usage of GrpcServerRule to GrpcCleanupRule.

* make constant fields static

* use GrpcCleanupRule to register InProcessChannel to avoid manual shutdown.

* Make class public and match the usage of grpclb's load reporting server tracer.

* added ExperimentalApi annotation
2019-07-29 14:46:24 -07:00
Chengyuan Zhang 50df56f949
xds: add a missing test case for CallMetricRecorder and polish test data. (#6019) 2019-07-29 14:43:42 -07:00
Carl Mastrangelo 57e7bd394e
all: update to proto 3.9.0 2019-07-26 13:53:05 -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
ZHANG Dapeng 4114433674
doc: Add hint to users who want an experimental API to be stabilized 2019-07-26 09:22:53 -07:00
Chengyuan Zhang f15a6bd363
services: implement a lb policy agnostic call metric recorder for backend applications (#6004)
* services: implement a lb policy agnostic call metric recorder for backend applications.

* Renamed snapshot() to finalizeAndDump() and make it package-private with an internal accessor class.

* Added Javadoc link for Context.

* Added ExperimentalApi annotation.

* Added since annotations.
2019-07-25 15:39:22 -07:00
Carl Mastrangelo 06e9b88147
netty: bump to 4.1.38
* netty: bump to 4.1.38
2019-07-24 14:29:26 -07:00
Jihun Cho 102f0f8ac8 core: fix linter error 2019-07-24 13:52:52 -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
ZHANG Dapeng d7b9438d39
util: a util to gracefully switch load balancer when lb policy changes
Following the section "Gracefully Switching LB Policies" in the spec go/grpc-client-channel-spec
2019-07-22 13:42:07 -07:00
Jihun Cho 1fbc61b280 alts: provide channel type to HandshakerServiceChannel to suppress warning 2019-07-22 09:50:03 -07:00
Ran f261af3445
java_grpc_library.bzl: Migrate from 'proto' to ProtoInfo syntax (#5994)
* Migrate the provider containing information about protocol buffers from the old-style 'dep.proto' pattern to the new-style 'dep[ProtoInfo]' one.
2019-07-19 16:06:47 -07:00
Carl Mastrangelo cc524f10d3
netty,interop-testing: increase timeouts on tests for TSAN 2019-07-19 15:24:19 -07:00
Carl Mastrangelo 148b7de357
stub: avoid race in onHalfClose server StreamObserver 2019-07-19 12:24:34 -07:00
Carl Mastrangelo 8a9afd618a
context: fix race between CancellableContext and Context
The `pendingDeadline` variable is modified from the ctor of CancellableContext, but it isn't final.  The cancellation can happen before the variable is assigned.  It's generally bad practice to leak the this reference from the ctor to other threads anyways.

This code refactors the deadline calculation and scheduling so that `pendingDeadline` is modified under the lock, and the `this` reference is not exposed.

Discovered by TSAN.
2019-07-17 01:12:21 -07:00
Chengyuan Zhang b477cc2a47
cronet: add accessor class for CronetChannelBuilder to avoid exposing setTrafficStats* API directly. (#5983) 2019-07-15 16:46:41 -07:00
Carl Mastrangelo 25a72e1f6d
netty: don't share transport tracers across transports
Found using TSAN, which shows the number of calls succeeded being incremented from multiple event loops
2019-07-15 11:18:35 -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 855740622a
all: bump PerfMark to 0.17.0
* Bump PerfMark to 0.17.0

The main changes how linking is done.  Linking is now always done
through the `PerfMark` entry class.   This is for two reasons:

1.  It make instrumenting the linking calls *much* easier.
2.  It follows the API pattern of "verbNoun()".  Previous callsites
    would have `Link link = PerfMark.link(); link.link()`.  This
    stuttering is not quick to follow.

Generated using:

```
find -name \*.java -exec sed -i 's#link = PerfMark.link();#link = PerfMark.linkOut();#g' {} \;
find -name \*.java -exec sed -i 's#link.link();#PerfMark.linkIn(link);#g' {} \;
find -name \*.java -exec sed -i 's#command.getLink().link();#PerfMark.linkIn(command.getLink());#g' {} \;
find -name \*.java -exec sed -i 's#cmd.getLink().link();#PerfMark.linkIn(cmd.getLink());#g' {} \;
find -name \*.java -exec sed -i 's#msg.getLink().link();#PerfMark.linkIn(msg.getLink());#g' {} \;
```

Since the deprecated link methods are also `@DoNotCall`, the same
sed calls will need to be used on import.
2019-07-11 10:57:05 -07:00
Chengyuan Zhang d30c304d8f
xds: Fix bug of locality store not update weights for existing localities (#5976)
* Fixed LocalityStore test relying on WeightChildPicker list order for mapping to its corresponding locality.

* Fixed bug for not updating new weights for existing localities.
2019-07-11 09:44:40 -07:00
Jihun Cho 77ee79cc15 Update README to reference 1.22.1 2019-07-10 17:20:16 -07:00
Chengyuan Zhang ce830bc3bf
xds: Remove unnecessary subchannel creation by helper, use mocked subchannels directly. (#5977) 2019-07-10 16:57:02 -07:00
Lukacs T. Berki e341d4c655 Make .proto import path computation work with virtual protos in the main repository.
Also fix grammar.
2019-07-10 13:52:08 -07:00
ZHANG Dapeng d648e8f2df xds: update envoy to 89eb31bcbe2308bf1e9073620e843bf472363495 (#5972)
* xds: update envoy to 89eb31bcbe2308bf1e9073620e843bf472363495

* run import.sh
2019-07-09 21:19:53 -07:00
Jihun Cho d974bea4b1
core: fix terminated status check in TransportListener (#5955) 2019-07-09 16:36:36 -07:00
Mike Kobit 6615f2fc9d Add `@Nullable` to getter for trailers on `StatusRuntimeException` since the constructors allows it to be null 2019-07-09 15:56:42 -07:00