Commit Graph

6173 Commits

Author SHA1 Message Date
Matthew Stevenson eece0c034a
[tls] Backport of #34861 to v1.56.x. (#35795)
Co-authored-by: Luwei Ge <lwge@google.com>
2024-02-05 11:04:00 -08:00
Mark D. Roth 484820a800
[WRR] backport #33694 to 1.56 (#33698) 2023-07-13 17:42:40 -07:00
Esun Kim d9d47b5a18
[WRR] Backport 1.56: Prefer application_utilization to cpu_utilization (#33378)
Backport of #33355

Co-authored-by: Yousuk Seung <ysseung@google.com>
2023-06-09 12:18:31 -07:00
Mark D. Roth ded9a15723
[outlier detection] backport to 1.56: hack to prevent OD from working with pick_first (#33347)
Back-port #33336 to 1.56.
2023-06-05 13:01:58 -07:00
apolcyn 91ff8b2bca
[Rls] Backport "[Rls] de-experimentalize RLS in XDS (#33290)" to v1.56.x (#33330)
Backport #33290 to 1.56.x.
2023-06-02 14:05:54 -07:00
Luwei Ge d1c0dc58cc
[Audit Logging] xDS e2e test for audit logging. (#33252)
Added tests involve:
1. Checking the # of logger invocations with multiple RBACs in the
chain.
2. Verifying content in audit context with action and audit condition
permutations.
3. Confirm custom logger and built-in logger configurations are working.
4. Confirm the feature is protected by the environment variable.

---------

Co-authored-by: rockspore <rockspore@users.noreply.github.com>
2023-05-26 12:43:37 -07:00
Mark D. Roth 52d687ad42
[xDS] second attempt: clean up cert provider factory and registry APIs (#33249)
Original was #33226, reverted in #33248.
2023-05-25 12:59:21 -07:00
Craig Tiller 9faa39d88b
Revert "[xDS] clean up cert provider factory and registry APIs" (#33248)
Reverts grpc/grpc#33226

(looks to be creating some import problems)
2023-05-25 09:56:01 -07:00
Mark D. Roth eb2b1edd1c
[xDS] clean up cert provider factory and registry APIs (#33226)
- switch to json_object_loader for config parsing
- use `absl::string_view` instead of `const char*` for cert provider
names
- change cert provider registry to use a map instead of a vector
- remove unused mesh_ca cert provider factory
2023-05-24 15:38:39 -07:00
Luwei Ge de9d398e8f
[Audit Logging] End2end test for audit logging in authorization policy (#33196)
I generated a new client key and cert where a Spiffe ID is added as the
URI SAN. As such, we are able to test the audit log contains the
principal correctly.

Update: I switched to use the test logger to verify the log content and
removed stdout logger here because one the failure of [RBE Windows Debug
C/C++](https://source.cloud.google.com/results/invocations/c3187f41-bb1f-44b3-b2b1-23f38e47386d).

Update again: Refactored the test logger in a util such that the authz
engine test also uses the same logger. Subsequently, xDS e2e test will
also use it.

---------

Co-authored-by: rockspore <rockspore@users.noreply.github.com>
2023-05-24 14:09:32 -07:00
Hannah Shi 988c85535d
[ObjC] Upgrade podspec xx.deployment_target (#33091)
Upgrade apple platform deployment_target versions to fix the cocoapods
push of BoringSSL-GRPC about the following error:
```
ld: file not found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
ref: https://developer.apple.com/forums/thread/725300

This also aligns with the versions required by
[protobuf](https://github.com/protocolbuffers/protobuf/pull/10652)

```
ios.deployment_target = '10.0'
osx.deployment_target = '10.12'
tvos.deployment_target = '12.0'
watchos.deployment_target = '6.0'
```
2023-05-20 20:38:24 +00:00
Mark D. Roth a78001a087
[resolver] remove unused ctor for ServerAddress (#33148)
Co-authored-by: markdroth <markdroth@users.noreply.github.com>
2023-05-16 16:53:01 -07:00
AJ Heller 252ebad341
[infra] Fix absl::Mutex check and remove all uses (#33144)
`tools/run_tests/sanity/check_absl_mutex.sh` was broken, a missing paren
crashed the script if run locally. It's unclear yet how our sanity
checks were not complaining about this, `run_tests.py` does not save the
log.
2023-05-16 12:50:52 -07:00
Mark D. Roth 8fdfb22848
[JSON] generalize handling of RefCountedPtr<> (#33048)
Also remove a check in the weighted_target LB policy that I somehow
missed in #32932.
2023-05-11 13:49:59 -07:00
Yash Tibrewal 1b01336504
[Logging] Fix flakiness in test (#33077)
Change - just make sure that before we verify the logging entries, we'll
wait for the expected number of entries to show up.

Logging_test has been recently reported as flaky. Sample failure -
https://source.cloud.google.com/results/invocations/ba581ad8-b652-4b9d-af56-07593f5d2deb/targets/%2F%2Ftest%2Fcpp%2Fext%2Ffilters%2Flogging:logging_test@poller%3Depoll1/tests

Failed to reproduce, but i have a suspicion that what's happening is
that the logging for the half-close events on the server side can happen
after the call has ended.. It is currently being logged after the
server-trailer (which has the status).
2023-05-11 11:15:47 -07:00
Mark D. Roth 1432fe4e4c
[JSON] make API public but experimental (#32987)
This makes the JSON API visible as part of the C-core API, but in the
`experimental` namespace. It will be used as part of various
experimental APIs that we will be introducing in the near future, such
as the audit logging API.
2023-05-09 08:05:24 -07:00
AJ Heller 3fb738b9b1
[EventEngine] Implement work-stealing in the EventEngine ThreadPool (#32869)
This PR implements a work-stealing thread pool for use inside
EventEngine implementations. Because of historical risks here, I've
guarded the new implementation behind an experiment flag:
`GRPC_EXPERIMENTS=work_stealing`. Current default behavior is the
original thread pool implementation.

Benchmarks look very promising:

```
bazel test \
--test_timeout=300 \
--config=opt -c opt \
--test_output=streamed \
--test_arg='--benchmark_format=csv' \
--test_arg='--benchmark_min_time=0.15' \
--test_arg='--benchmark_filter=_FanOut' \
--test_arg='--benchmark_repetitions=15' \
--test_arg='--benchmark_report_aggregates_only=true' \
test/cpp/microbenchmarks:bm_thread_pool
```

2023-05-04: `bm_thread_pool` benchmark results on my local machine (64
core ThreadRipper PRO 3995WX, 256GB memory), comparing this PR to
master:


![image](https://user-images.githubusercontent.com/295906/236315252-35ed237e-7626-486c-acfa-71a36f783d22.png)

2023-05-04: `bm_thread_pool` benchmark results in the Linux RBE
environment (unsure of machine configuration, likely small), comparing
this PR to master.


![image](https://user-images.githubusercontent.com/295906/236317164-2c5acbeb-fdac-4737-9b2d-4df9c41cb825.png)

---------

Co-authored-by: drfloob <drfloob@users.noreply.github.com>
2023-05-08 13:38:23 -07:00
Mark D. Roth 1fcaccdf5f
[client channel] Second attempt: use ChunkedVector for call attributes (#33015)
Original was #33002, reverted in #33014.

The second commit here adds a build visibility tag necessary to fix the
internal build problems.
2023-05-04 15:11:07 -07:00
AJ Heller 18aab6ffb5
Revert "[client channel] use ChunkedVector for call attributes" (#33014)
Reverts grpc/grpc#33002. Breaks internal builds:
`.../privacy_context:filters does not depend on a module exporting
'.../src/core/lib/channel/context.h'`
2023-05-04 10:55:21 -07:00
Mark D. Roth 2f89fd5528
[client channel] use ChunkedVector for call attributes (#33002)
Change call attributes to be stored in a `ChunkedVector` instead of
`std::map<>`, so that the storage can be allocated on the arena. This
means that we're now doing a linear search instead of a map lookup, but
the total number of attributes is expected to be low enough that that
should be okay.

Also, we now hide the actual data structure inside of the
`ServiceConfigCallData` object, which required some changes to the
`ConfigSelector` API. Previously, the `ConfigSelector` would return a
`CallConfig` struct, and the client channel would then use the data in
that struct to populate the `ServiceConfigCallData`. This PR changes
that such that the client channel creates the `ServiceConfigCallData`
before invoking the `ConfigSelector`, and it passes the
`ServiceConfigCallData` into the `ConfigSelector` so that the
`ConfigSelector` can populate it directly.
2023-05-04 08:33:51 -07:00
Craig Tiller 65a2a895af
[chttp2] Fix some fuzzer found bugs. (#33005)
<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
2023-05-03 18:18:10 -07:00
Mark D. Roth 844e740183
[JSON] Replace ctors with factory methods (#32834) 2023-05-02 09:22:42 -07:00
Yousuk Seung 8b02295e58
[xDS] Accept cpu_utilization over 100% (#32954)
<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
2023-05-02 03:25:17 +00:00
Mark D. Roth 020e9b4dd6
[WRR] Remove env var guard for WRR policy (#32936)
- remove the `_experimental` suffix from the gRPC policy name
- remove the env var guard for the xDS policy config
2023-04-26 09:40:22 -07:00
apolcyn 017d9943ef
[XDS] Revert "Revert "XDS: enable XDS federation by default (#32711)" (#32814) (#32902)
Previous lack-of-load-reporting issue has been fixed (b/276944116)
2023-04-20 08:00:10 -07:00
Esun Kim c523bdac1e
[C++] Added a cord support to gRPC protobuf serializer (#32617)
As Protobuf is going to support Cord to reduce memory copy when
[de]serializing Cord fields, gRPC is going to leverage it. This
implementation is based on the internal one but it's slightly modified
to use the public APIs of Cord. only
2023-04-19 08:55:25 -07:00
Eugene Ostroukhov e59a3e25ca
[xds] Remove variable protection from custom LB policies (#32888) 2023-04-18 15:53:41 -07:00
Yash Tibrewal e49cfd494c
[GCP Observability C++] Add empty config test (#32790)
<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
2023-04-14 16:42:47 -07:00
Mark D. Roth 26df3d14e2
[XDS] fix federation bug that prevented load reports from being sent (#32826)
This bug occurred when the same xDS server was configured twice in the
same bootstrap config, once in an authority and again as the top-level
server. In that case, we were incorrectly failing to de-dup them and
were creating a separate channel for the LRS stream than the one that
already existed for the ADS stream. We fix this by canonicalizing the
server keys the same way in both cases.

As a separate follow-up item, I will work on trying to find a better way
to key these maps that does not suffer from this kind of fragility.
2023-04-14 14:31:12 -07:00
Yash Tibrewal 4a1bf8778b
[OpenCensus Test] Don't depend on compression algorithm (#32863)
We shouldn't depend on how much the compression algorithm compresses the
bytes to. This is causing flakiness internally.

<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
2023-04-14 00:37:07 +00:00
AJ Heller 8f6ae3599f
[revert] Revert "Revert "[EventEngine] Implement the EventEngine-driven client channel resolver" (#32768)" (#32772)
This is a clean, OSS-only revert of
https://github.com/grpc/grpc/pull/32632, but depends on
https://github.com/grpc/grpc/pull/32771 landing first, which requires a
cherrypick.
2023-04-12 16:30:01 -07:00
AJ Heller c268ac2c25
[revert] Revert "Revert "[gprpp] Add ValidationErrors::message retrieval" (#32767)". (#32771)
This reverts commit 4f444aaabf, which
needed a cherrypick.
2023-04-10 13:11:53 -07:00
Mark D. Roth 9393cd887c
[JSON] remove mutable accessor methods. (#32806)
Co-authored-by: markdroth <markdroth@users.noreply.github.com>
2023-04-06 13:37:42 -07:00
Craig Tiller 63c094cf5b
[promises] Run C++ end to end tests with server promises (#32537)
Expand server promises to run with C++ end2end tests.

Across connected_channel/call/batch_builder/pipe/transport:
- fix a bug where read errors weren't propagated from transport to call
so that we can populate failed_before_recv_message for the c++ bindings
- ensure those errors are not, however, used to populate the returned
call status

Add a new latch call arg to lazily propagate the bound CQ for a server
call (and client call, but here it's used degenerately - it's always
populated). This allows server calls to be properly bound to
pollsets.(1)/(2)

In call.cc:
- move some profiling code from FilterStackCall to Call, and then use it
in PromiseBasedCall (this should be cleaned up with tracing work)
- implement GetServerAuthority

In server.cc:
- use an RAII pattern on `MatchResult` to avoid a bug whereby a tag
could be dropped if we cancel a request after it's been matched but
before it's published
- fix deadline export to ServerContext

In resource_quota_server.cc:
- fix some long standing flakes (that were finally obvious with the new
test code) - it's legal here to have client calls not arrive at the
server due to resource starvation, work through that (includes adding
expectations during a `Step` call, which required some small tweaks to
cq_verifier)

In the C++ end2end_test.cc:
- strengthen a flaky test so it passes consistently (it's likely we'll
revisit this with the fuzzing efforts to strengthen it into an actually
robust test)

(1) It's time to remove this concept
(2) Surprisingly the only test that *reliably* demonstrates this not
being done is time_change_test

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-04-06 12:32:23 -07:00
Stanley Cheung 2845a248d6
[GcpObservability] Remove sleep from observability test client (#32817)
.. as it is now part of the `GcpObservabilityClose()` routine
[itself](https://github.com/grpc/grpc/pull/32715/files#diff-e1ce0ccb4650e20b62a6d6b31655f446ad9ef72efca5849143e65f4a5a5e0310R223).

Background: #32715 may have broken the CI for observability interop
testing. The client seems to be taking too long to finish. More info at
b/277145074

We need to backport this to the `v1.54.x` branch if this is the right
fix.
2023-04-06 05:25:22 +00:00
apolcyn b0636e7a23
Revert "XDS: enable XDS federation by default (#32711)" (#32814)
This reverts commit 4b46dbc19e.

Reason: this seems to be breaking load reports in certain cases,
b/276944116

Let's revert so this doesn't accidentally get released.
2023-04-05 17:34:23 -07:00
Yash Tibrewal bdd1ac4d1d
[GcpObservability C++] De-experimentalize API (#32715)
This PR aims to de-experimentalize the APIs for GCP Observability. 

We would have ideally wanted public feedback before declaring the APIs
stable, but we need stable APIs for GA.

Changes made after API review with @markdroth @veblush, @ctiller and the
entire Core/C++ team -
* The old experimental APIs `grpc::experimental::GcpObservabilityInit`
and `grpc::experimental::GcpObservabilityClose` are now deprecated and
will be deleted after v.1.55 release.
* The new API gets rid of the Close method and follows the RAII idiom
with a single `grpc::GcpObservability::Init()` call that returns an
`GcpObservability` object, the lifetime of which controls when
observability data is flushed.
* The `GcpObservability` class could in the future add more methods. For
example, a debug method that shows the current configuration.
* Document that GcpObservability initialization and flushing (on
`GcpObservability` destruction) are blocking calls.
* Document that gRPC is still usable if GcpObservability initialization
failed. (Added a test to prove the same).
* Since we don't have a good way to flush stats and tracing with
OpenCensus, the examples required users to sleep for 25 seconds. This
sleep is now part of `GcpObservability` destruction.

Additional Implementation details -
* `GcpObservability::Init` is now marked with `GRPC_MUST_USE_RESULT` to
make sure that the results are used. We ideally want users to store it,
but this is better than nothing.
* Added a note on GCP Observability lifetime guarantees.

<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
2023-04-05 21:45:21 +00:00
Eugene Ostroukhov be99673d06
[PSM interop test] implement error-code- RPC behavior (#32810)
This reverts commit 47ea5062cb.
2023-04-05 11:56:50 -07:00
Craig Tiller 724441d85b
[tests] Convert core e2e tests to gtest (#32603)
Notes:
- `+trace` fixtures haven't run since 2016, so they're disabled for now
(7ad2d0b463 (diff-780fce7267c34170c1d0ea15cc9f65a7f4b79fefe955d185c44e8b3251cf9e38R76))
- all current fixtures define `FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER`
and hence `authority_not_supported` has not been run in years - deleted
- bad_hostname similarly hasn't been triggered in a long while, so
deleted
- load_reporting_hook has never been enabled, so deleted
(f23fb4cf31/test/core/end2end/generate_tests.bzl (L145-L148))
- filter_latency & filter_status_code rely on global variables and so
don't convert particularly cleanly - and their value seems marginal, so
deleted

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-04-03 22:19:57 -07:00
Craig Tiller 47ea5062cb
Revert "[xds interop tests] implement error-code- RPC behavior" (#32769)
Reverts grpc/grpc#32765
2023-03-31 22:16:48 -07:00
Craig Tiller 4f444aaabf
Revert "[gprpp] Add ValidationErrors::message retrieval" (#32767)
Reverts grpc/grpc#32761
2023-03-31 21:42:58 -07:00
Craig Tiller b5a2e90fbf
Revert "[EventEngine] Implement the EventEngine-driven client channel resolver." (#32768)
Reverts grpc/grpc#32632

Needs to be rolled back for #32767 to land
2023-03-31 21:31:27 -07:00
BrandonY bc6a2ee918
[RLS] Change case of RLS 'x-google-rls-data' header to lowercase. (#32760)
"X-Google-RLS-Data" does not work as gRPC metadata key.
2023-03-31 17:09:38 -07:00
Eugene Ostroukhov 50fce40409
[PSM Interop] Add custom_lb test client (#32757) 2023-03-31 14:03:44 -07:00
Eugene Ostroukhov a4af6250d8
[xds interop tests] implement error-code- RPC behavior (#32765)
Implements handling for the `error-code-xx` `rcp-behavior` header.
Compare to similar implementation in
[java-server](42b4c61d5e/interop-testing/src/main/java/io/grpc/testing/integration/XdsTestServer.java (L379))
2023-03-31 13:58:43 -07:00
AJ Heller 7dec55de5a
[EventEngine] Implement the EventEngine-driven client channel resolver. (#32632)
This PR also centralizes the client channel resolver selection. Resolver
selection is still done using the plugin system, but when the Ares and
native client channel resolvers go away, we can consider bootstrapping
this differently.
2023-03-31 13:52:06 -07:00
AJ Heller b94d55bd20
[gprpp] Add ValidationErrors::message retrieval (#32761)
For cases where an absl::Status is unnecessary.
2023-03-31 11:56:06 -07:00
Mark D. Roth 36d2716d52
[JSON] move Parse() and Dump() methods out of JSON object (#32742)
More prep for making this a public API.
2023-03-30 13:30:54 -07:00
Mark D. Roth 656e5f283b
[JSON] use updated style for enum values (#32741)
More preparation for making this a public API.
2023-03-30 09:39:07 -07:00
Yousuk Seung c02b3e695c
xDS: Include orca named_metrics in LRS load reports (#32690)
<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
2023-03-28 12:04:01 -07:00