Commit Graph

6198 Commits

Author SHA1 Message Date
Craig Tiller b7077f4bbf
[hpack] Rollforward huffman read optimization (#33657)
Rollforward in first commit, fixes in subsequent.
2023-07-11 15:26:54 -07:00
Craig Tiller 57c697d8ae
Revert "[hpack] Huffman read optimization" (#33655)
Reverts grpc/grpc#33269
2023-07-11 12:58:49 -07:00
Craig Tiller 4ce51fe45d
[hpack] Huffman read optimization (#33269)
In real services most of our time ends up in the `Read1()` function,
which populates one byte into the bit buffer.
Change this to read in as many as possible bytes at a time into that
buffer.

Additionally, generate all possible (to some depth) parser geometries,
and add a benchmark for them. Run that benchmark and select the best
geometry for decoding base64 strings (since this is the main use-case).

(gives about a 30% speed boost parsing base64 then huffman encoded
random binary strings)

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-07-11 08:41:15 -07:00
Eugene Ostroukhov e0bc8a2c85
[xDS LB] xDS pick first support (#33540) 2023-06-30 14:06:08 -07:00
Mark D. Roth 51e54ed636
[outlier detection] remove support for ejection via raw connectivity state (#33427)
More work on the dualstack backend design:
- Now that all petiole policies have been changed to delegate to
pick_first, outlier detection no longer needs to eject via the
subchannel's raw connectivity state; it can now eject only via the
health state. See #33340.
- This also removes the now-unnecessary hack to explicitly disable
outlier detection in pick_first. See #33336.
2023-06-28 08:44:04 -07:00
Mark D. Roth f09357ccb4
[ring hash] delegate to pick_first instead of creating subchannels directly (#33093)
More work on the dualstack backend design:
- Change ring_hash policy to delegate to pick_first instead of creating
subchannels directly.
- Note that, as mentioned in the WIP gRFC, because we lazily create the
pick_first child policies, so there's no need to swap over to a new list
as an atomic whole. As a result, we don't use the endpoint_list library
in this policy; instead, we just update a map in-place.
- Remove now-unused subchannel_list library.
2023-06-28 06:49:53 -07:00
Yash Tibrewal 98417f3bd0
Revert "Revert "[otel] Add bazel dependency"" (#33560)
Reverts grpc/grpc#33559
2023-06-27 12:28:47 -07:00
Mark D. Roth 017153a0c5
Revert "[otel] Add bazel dependency" (#33559)
Reverts grpc/grpc#33548
2023-06-27 10:34:45 -07:00
Mark D. Roth 27a778fece
[round robin] delegate to pick_first instead of creating subchannels directly (#32692)
More work on the dualstack backend design:
- Change round_robin to delegate to pick_first instead of creating
subchannels directly.
- Change pick_first such that when it is the child of a petiole policy,
it will unconditionally start a health watch.
- Change the client-side health checking code such that if client-side
health checking is not enabled, it will return the subchannel's raw
connectivity state.
- As part of this, we introduce a new endpoint_list library to be used
by petiole policies, which is intended to replace the existing
subchannel_list library. The only policy that will still directly
interact with subchannels is pick_first, so the relevant parts of the
subchannel_list functionality have been copied directly into that
policy. The subchannel_list library will be removed after all petiole
policies are updated to delegate to pick_first.
2023-06-27 09:54:12 -07:00
Yash Tibrewal 875b7fdcff
[otel] Add bazel dependency (#33548)
Add bazel dependency on opentelemetry-cpp.
<!--

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-06-27 00:47:01 -07:00
Esun Kim 16a11fadff
[Test] Explicitly cast `enum class` to `int` before passing it with a format string (#33554)
Corresponding internal cl/542804880

> Explicitly cast `enum class` to `int` before passing it with a format
string.
> 
> Next version of the crosstool will start warning about this (see:
>
[https://github.com/llvm/llvm-project/issues/38717](https://www.google.com/url?sa=D&q=https%3A%2F%2Fgithub.com%2Fllvm%2Fllvm-project%2Fissues%2F38717))
2023-06-26 23:18:09 -07:00
Mark D. Roth 8427bacaea
[resolver API] remove address attribute interface (#33514)
The address attribute interface was intended to provide a mechanism to
pass attributes separately from channel args, for values that do not
affect subchannel behavior and therefore do not need to be present in
the subchannel key, which does include channel args. However, the
mechanism as currently designed is fairly clunky and is probably not the
direction we will want to go in the long term.

Eventually, we will want some mechanism for registering channel args,
which would provide a cleaner way to indicate that a given channel arg
should not be used in the subchannel key, so that we don't need a
completely different mechanism. For now, this PR is just doing an
interim step, which is to establish a special channel arg key prefix to
indicate that an arg is not needed in the subchannel key.
2023-06-26 10:02:06 -07:00
Eugene Ostroukhov fc4736c1ad
[interop] Fix crash in pick_first LB policy (#33519)
Fixes http://b/288420022
2023-06-22 16:29:15 -07:00
Yash Tibrewal 441ff0e757
[logging] Add tests for cases where we don't send any metadata and improve debuggability (#33486)
<!--

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-06-21 14:48:23 -07:00
Vignesh Babu cd4ff81b3f
Revert "Revert "[resource quota] Fix bugs in iomgr and event engine endpoint interactions with resource quota"" (#33499)
Reverts grpc/grpc#33417

Deadlock
https://fusion2.corp.google.com/invocations/99834386-79ff-4707-86eb-52e604774ea9/details
fixed in the c9a1bdc3dc commit.
2023-06-21 09:36:44 -07:00
Eugene Ostroukhov d55431995c
[interop] Implement "hostname" for RPC behavior (#33446)
This enables outlier detection test. See #33135
2023-06-16 11:14:01 -07:00
Mark D. Roth d20e8d141b
[LB policies] add delegating helper classes (#33445)
This eliminates the need to modify every parent policy whenever we add
new helper methods. It should also eliminate some binary bloat.
2023-06-15 08:08:47 -07:00
Eugene Ostroukhov 6451beba8e
Revert "Revert "Revert "Revert "[xDS LB] Override cluster with value … (#33424)
Previous attempt: #33416

This reverts commit 19460ea82f.
2023-06-14 13:42:59 -07:00
Mark D. Roth f34a39af74
[xDS e2e tests] add 1K RPCs to try to work around statistical problem (#33409) 2023-06-14 10:58:15 -07:00
Craig Tiller 80dbe90c18
Revert "[resource quota] Fix bugs in iomgr and event engine endpoint interactions with resource quota" (#33417)
Reverts grpc/grpc#33375

Breaks import
2023-06-13 08:11:53 -07:00
Craig Tiller 19460ea82f
Revert "Revert "Revert "[xDS LB] Override cluster with value from cookie"" (#33379)" (#33416)
Reverts grpc/grpc#33388

Breaks import
2023-06-13 07:23:46 -07:00
Vignesh Babu e6c1b13aed
[resource quota] Fix bugs in iomgr and event engine endpoint interactions with resource quota (#33375)
The following bugs are fixed:

* Missing ExecCtx in event engine endpoints and listeners
* Ref counting issue with iomgr endpoint which causes crashes in
overloaded situations

The PR includes a test which triggers these bugs by simulating an
overloaded system.
2023-06-12 16:20:08 -07:00
Eugene Ostroukhov 57bb6fb65c
Revert "Revert "[xDS LB] Override cluster with value from cookie"" (#33388)
Reapplying #32973
2023-06-12 16:12:17 -07:00
Sergii Tkachenko de6ed9ba9f
[Python] Migrate from yapf to black (#33138)
- Switched  from yapf to black
- Reconfigure isort for black
- Resolve black/pylint idiosyncrasies 

Note: I used `--experimental-string-processing` because black was
producing "implicit string concatenation", similar to what described
here: https://github.com/psf/black/issues/1837. While currently this
feature is experimental, it will be enabled by default:
https://github.com/psf/black/issues/2188. After running black with the
new string processing so that the generated code merges these `"hello" "
world"` strings concatenations, then I removed
`--experimental-string-processing` for stability, and regenerated the
code again.

To the reviewer: don't even try to open "Files Changed" tab 😄 It's
better to review commit-by-commit, and ignore `run black and isort`.
2023-06-09 15:08:55 -07:00
Eugene Ostroukhov 6f685274a1
Revert "[xDS LB] Override cluster with value from cookie (#32973)" (#33379)
This reverts #32973 that causes breakages in internal CI.
2023-06-08 16:50:47 -07:00
Eugene Ostroukhov 8fe3472e53
[xDS LB] Override cluster with value from cookie (#32973) 2023-06-08 13:52:13 -07:00
Yousuk Seung c03cd744b2
[WRR] Prefer application_utilization to cpu_utilization (#33355)
<!--

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-06-07 17:38:29 -07:00
Mark D. Roth 6b4a1e4243
[outlier detection] hack to prevent OD from working with pick_first (#33336)
As per discussion in #32967.
2023-06-05 10:59:40 -07:00
apolcyn 889412c416
[Rls] de-experimentalize RLS in XDS (#33290)
Integration tests are passing, so we should be ready to
de-experimentalize.

Related: internal bug b/265209578
2023-06-02 12:26:45 -07:00
Eugene Ostroukhov 0980076bb9
[interop] fix C++ server to add mutex for orca_oob test (#33278)
Following improvements were made to `orca_oob` interop test to increase
compatibility and stability:

1. Timeout was increased to 10s (see #33098)
2. Server will block clients trying to run this test concurrently.
3. Data is cleared in the beginning of the call.
2023-05-31 20:07:51 -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