Commit Graph

762 Commits

Author SHA1 Message Date
Craig Tiller d139c4a014
[metadata] Add an experiment to ensure a unique refcount on parsed slice strings (#33205)
The intuition here is that these strings may end up in the hpack table,
and then unnecessarily extend the lifetime of the read blocks.

Instead, take a copy of these short strings when we need to and allow
the incoming large memory object to be discarded.

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-07-05 20:57:03 -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
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
Eugene Ostroukhov 297db35a58
[third_party] update @envoy-api (#33539)
Updates to head, required to support xDS configuration for the
pick-first
2023-06-23 15:38:33 -07:00
Florian Ferstl fa32eb36b3
[bazel] Auto-generate .pyi files in py_proto_library rule (#32872)
With some delay, this is a PR for
https://github.com/grpc/grpc/issues/32564 (and previously
https://github.com/grpc/grpc/pull/31791).

I looked into adding a regular `py_test` for this change [as
suggested](https://github.com/grpc/grpc/pull/31791#issuecomment-1423245116)
but I am not aware of any effect that the presence of a .pyi stub file
would have at runtime and where some sort of type-checking in a .py
script would be affected. Stub files are only for use by type checkers &
IDE's. I mean, something like this would work:

```
import helloworld_pb2
py_file = helloworld_pb2.__file__ 
pyi_file = py_file + 'i’
self.assertTrue(os.path.exists(pyi_file))
```

But that seems really hacky to me. Instead I created a simple rule test
for `py_proto_library` with Bazel Skylib which tests the declared
outputs for an example `py_proto_library` target. Indirectly, this also
tests that the declared output files are actually generated. Please let
me know if this is sufficient.
2023-06-12 14:36:24 -07:00
apolcyn 017786f151
[c-ares] Upgrade c-ares dependency to 1.19.1 (#33392)
WIP
2023-06-12 13:38:20 -07:00
Craig Tiller a63849bd39
[ios] damage control (#33391)
~Something about the additional load from #33374 has caused some
entirely unrelated ios tests to fail sporadically. I'd prefer not to
roll back that however as it's discovered real bugs that had been
previously masked.~

These tests have been failing sporadically for some time.

We can track these on the daily flakiness reports, but whilst we
investigate let's just universally mark them as flaky so we don't
confuse folks trying to submit.
2023-06-09 12:37:34 -07:00
AJ Heller f974491065
[EventEngine] Return work stealing experiment to CI-only (#33389)
There is potential for a long shutdown process under load (seconds
instead of milliseconds).
2023-06-09 12:37:20 -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
AJ Heller 28692fdcae
[EventEngine] Enable work stealing thread pool in debug builds (#33333) 2023-06-06 15:50:31 -07:00
Xuan Wang 629b7a14da
[python O11Y] Initial Implementation (#32974)
Testing Command: `bazel test --cache_test_results=no
--test_output=streamed --runs_per_test=1 --test_timeout=10
"//src/python/grpcio_tests/tests/observability:_observability_test"`

### TODO:
 * Better error handling.
2023-06-05 16:11:52 -07:00
Xuan Wang 0c6902e32e
[Bazel Python3.11] Update Bazel dependencies for Python 3.11 (#33318)
We just found out that our current Bazel setup does not support Python
3.11.

Thus PR updates some dependencies to allow using Bazel in Python 3.11.

Cython:
* Cython [backported Python 3.11 support change to
0.29x](https://github.com/cython/cython/issues/4500), but it appears
that the Cython version we are using in Bazel does not include the fix,
so we're using the latest stable version instead.

Gevent:
* The first version of gevent that supports [Python 3.11 is
22.08.0](https://github.com/gevent/gevent/issues/1903#issuecomment-1303227507).

#### Testing
* Tested locally using Python 3.11 virtual environment, was able to
reproduce the issue and verified that those changes were able to fix it.
2023-06-01 15:32:16 -07:00
Vignesh Babu 173d225150
[experiments] Add a grpc_generate_one_off_internal_targets hook in the BUILD file (#33307)
This allows us to define and insert internal only targets.
2023-06-01 10:23:00 -07:00
AJ Heller 3225a9f117
[EventEngine] Disable EventEngine polling in gRPC Python (#33279)
This is a hack to get around an issue on Apple devices caused by the
PosixEventEngine's `poll` poller not supporting fork. This PR disables
the EventEngine poller entirely in Python builds. It will therefore
prevent the release of the EventEngine generally, and prevent any
testing of EventEngine integration with gRPC Python, until the `poll`
poller is fixed.
2023-05-30 19:26:44 -07:00
Yijie Ma 10001d16a9
[Release] Upmerge v1.55.x branch into master (#33277)
Change was created by the release automation script. See go/grpc-release

<!--

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.

-->

---------

Co-authored-by: Yash Tibrewal <yashkt@google.com>
Co-authored-by: Esun Kim <veblush@google.com>
Co-authored-by: Mark D. Roth <roth@google.com>
Co-authored-by: Yousuk Seung <ysseung@google.com>
Co-authored-by: Craig Tiller <ctiller@google.com>
Co-authored-by: Richard Belleville <rbellevi@google.com>
Co-authored-by: gnossen <gnossen@users.noreply.github.com>
2023-05-30 14:45:06 -07:00
Vignesh Babu d11a62e3d0
[experiments] Re-structure experiments codegen to make it more modular and re-usable (#33263) 2023-05-30 11:36:53 -07:00
Vignesh Babu 4d85f514cb
[experiments] Split experiments into two separate experiment definition and rollout definition files (#33228)
The PR does the following:

* Splits the single experiments.yaml file into two files:
experiments.yaml and rollouts.yaml.
* The experiments.yaml will now only include experiment definitions. The
default values of the experiments must now be specified in rollouts.yaml
* Removes the 'release' default value because it is not used.
* Adds an additional_constraints character string to ExperimentMetadata.
* Introduces a hook in src/core/lib/experiments/config.h to allow
registering arbitrary experiment constraint validation callbacks. These
callbacks would take an ExperimentMetadata object as input and return
the correct value to use for an experiment subject to additional
constraints.
2023-05-24 13:41:22 -07:00
Craig Tiller ad3c6273c6
[experiments] Remove flow_control_fixes experiment (#33230)
We defaulted this on 5 months ago, and it seems to be working... let's
remove the experiment bit!

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-05-24 10:20:26 -07:00
AJ Heller b225083b34
[test] Re-enable work stealing thread pool experiment (#33213)
I have not been able to reproduce the non-empty pool @ shutdown bug in
around 200k runs of various kinds. Now that experiments are marked flaky
by default, any similar failures should not block PR submission, and
this will give me good signal if the bugs reproduce more frequently in
the CI environment.

I have a fix in theory, but I don't think it should be necessary. If the
bug reproduces, I'll try the fix.
2023-05-22 16:46:38 -07:00
Esun Kim a3dae00f89
[Deps] Upgrade Protobuf to v23.1 (#33164)
Along with the required Abseil & upb upgrade.
2023-05-18 14:46:59 -07:00
Craig Tiller 0526a51734
[channel-args] Reland UnionWith optimizations (#33163)
Same as yesterday, with a fix in
695e2e24ba.
2023-05-17 17:23:58 -07:00
Yijie Ma 004ddbea90
[BoringSSL] Update third_party/boringssl-with-bazel (#33150)
Change was created by the release automation script. See go/grpc-release
2023-05-17 09:20:54 -07:00
Craig Tiller 6a742f0c2e
Revert "[channel_args] Optimize UnionWith" (#33159)
Reverts grpc/grpc#33154

breaks import
2023-05-17 09:20:33 -07:00
Craig Tiller cc3d034948
[channel_args] Optimize UnionWith (#33154)
<!--

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.

-->

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-05-16 19:55:55 -07:00
AJ Heller b35ea15265
[reland][fuzzing] Client channel resolver fuzzer (#33153)
This reverts commit 1624542ea4, relanding
https://github.com/grpc/grpc/pull/32956

Because of some proto dependency and build problems internally, I've
removed the ServiceConfig proto fuzzing component. These build issues
can hopefully be resolved soon, and then we can re-add the deleted
implementation from commit
[b078c9c](b078c9c015)
in this PR.
2023-05-16 17:32:29 -07:00
AJ Heller 1624542ea4
Revert "[fuzzing] Client channel resolver fuzzer" (#33152)
Reverts grpc/grpc#32956. Requires a cherrypick.
2023-05-16 13:00:06 -07:00
AJ Heller 030ecf60ec
[fuzzing] Client channel resolver fuzzer (#32956)
Co-authored-by: drfloob <drfloob@users.noreply.github.com>
2023-05-16 11:25:06 -07:00
Craig Tiller 8a8f1eba4b
[promises] Enable server promise calls in C++ e2e tests (#33097)
#thistimeforsure

a863532c62 adds some debug to help track
which batches get leaked by a transport
3203e75ec5 makes connected_channel respect
the high level intent of cancellation better (and fixes the last reason
we needed to turn these tests off)
aaf5fa036b re-enables testing of c++ e2e
tests with server based promise calls

<!--

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-15 15:01:21 -07:00
Craig Tiller a1e72482e4
[experiments] Assume enabling experiments is flaky (#33116)
This will change behavior for tests that have experiments enabled on
them to always have the flaky bit on.

In doing so, we'll get the usual failure reporting we do in the internal
chat bot, but allow PRs to pass even if an experiment isn't 100% passing
yet - reducing friction slightly for landing bigger experiments.

<!--

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-15 13:20:18 -07:00
Vignesh Babu b8a6b4267d
Revert "[test] Disable end2end tests for the EventEngine listener experiment" (#33100)
Reverts grpc/grpc#32968
2023-05-14 12:28:03 -07:00
AJ Heller 7b74b07885
[experiment] Disable work stealing end2end test experiments (#33081)
A known bug is being worked on. This will temporarily reduce flaky test
noise.
2023-05-11 16:46:15 +00:00
Esun Kim dc95133140
[Deps] Upgrade Protobuf v23 (#32914)
Upgrading Protobuf and Upb to v23.0
2023-05-09 12:24:21 -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
Craig Tiller 0e7cc360eb
[promises] Disable C++ e2e tests with server_promise_based_call for now (#33008)
<!--

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-04 18:21:12 +00:00
Craig Tiller ad41fe96b6
[promises] Re-enable C++ end2end tests (with fixes) (#32837)
Makes some awkward fixes to compression filter, call, connected channel
to hold the semantics we have upheld now in tests.

Once the fixes described here
https://github.com/grpc/grpc/blob/master/src/core/lib/channel/connected_channel.cc#L636
are in this gets a lot less ad-hoc, but that's likely going to be
post-landing promises client & server side.

We specifically need special handling for server side cancellation in
response to reads wrt the inproc transport - which doesn't track
cancellation thoroughly enough itself.

<!--

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.

-->

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-05-03 20:03:16 -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
AJ Heller e5725e4730
[test] Disable end2end tests for the EventEngine listener experiment (#32968)
Sanitizer issues found

MSAN:
https://source.cloud.google.com/results/invocations/f1667575-9397-41e9-ae8f-8560ddac9187/targets/%2F%2Ftest%2Fcore%2Fend2end:core_end2end_tests@poller%3Dpoll@experiment%3Devent_engine_listener/log

ASAN:
https://source.cloud.google.com/results/invocations/651d71a5-0676-4f0d-a109-531abe5d218e/targets/%2F%2Ftest%2Fcore%2Fend2end:core_end2end_tests@poller%3Depoll1@experiment%3Devent_engine_listener/log
2023-04-28 11:20:57 -07:00
AJ Heller a9afd1cde8
[test] Re-land: Enable EventEngine experiments for Posix end2end tests (#32948)
Relands #32844.

End2end tests will now wait for the default EventEngine to shut down
between tests. This should avoid some use-after-frees and leaks.
2023-04-27 09:50:40 -07:00
Esun Kim da5dbc068d
[Deps] Updated com_google_libprotobuf_mutator (#32937)
To get https://github.com/google/libprotobuf-mutator/pull/219 which is
required by Protobuf v23.
2023-04-25 19:06:54 -07:00
Esun Kim 3bd6c38650
[Infra] Use Bazel 6 and drop Bazel 4 (Part 2) (#32910)
Oops I missed important changes from
https://github.com/grpc/grpc/pull/32712. And it turned out that there
are two problems that I couldn't fix at this point.
- Windows Bazel RBE Linker Error: This may be caused by how new Bazel 6
invokes build tools chain but it's not clear. I put workaround to use
Bazel 5 by using `OVERRIDE_BAZEL_VERSION=5.4.1`
- Rule `rules_pods` to fetch CronetFramework from CocoaPod has
incompatibility with sort of built-in apple toolchain.
(https://github.com/bazel-xcode/PodToBUILD/issues/232): I couldn't find
a workaround to fix this so I ended up disabling all tests depending
this target.
2023-04-21 15:53:52 -07:00
Esun Kim 6e3dcc0df5
[Infra] Use Bazel 6 and drop Bazel 4 (#32712)
Let's move on as we'd agreed to drop 4.x
2023-04-20 14:40:20 -07:00
Vignesh Babu c515eba30b
[Transport] Update Chttp2 context list to include relative offset of traced RPCs within outgoing buffer (#32825)
The PR also creates a separate BUILD target for:
- chttp2 context list
- iomgr buffer_list
- iomgr internal errqueue

This would allow the context list to be included as standalone
dependencies for EventEngine implementations.
2023-04-20 09:32:27 -07:00
Yash Tibrewal b454d2d474
[BoringSSL] Update third_party/boringssl-with-bazel (#32868)
Change was created by the release automation script. See go/grpc-release
2023-04-14 10:41:08 -07:00
Xuan Wang 95c4df5d9b
[Python fix-it][Gevent] Enable gevent _dynamic_stubs_test (#32842)
Re-enable this test since it's now passing after gevent
reimplementation.

Fix: https://github.com/grpc/grpc/issues/15411
2023-04-12 14:03:31 -07:00
Jan Tattermusch 0f1afec5a8
[protobuf] Upgrade third_party/protobuf to 22.x (#32606)
The very non-trivial upgrade of third_party/protobuf to 22.x
This PR strives to be as small as possible and many changes that were
compatible with protobuf 21.x and didn't have to be merged atomically
with the upgrade were already merged.
Due to the complexity of the upgrade, this PR wasn't created
automatically by a tool, but manually. Subsequent upgraded of
third_party/protobuf with our OSS release script should work again once
this change is merged.

This is best reviewed commit-by-commit, I tried to group changes in
logical areas.

Notable changes:
- the upgrade of third_party/protobuf submodule, the bazel protobuf
dependency itself
- upgrade of UPB dependency to 22.x (in the past, we used to always
upgrade upb to "main", but upb now has release branch as well). UPB
needs to be upgraded atomically with protobuf since there's a de-facto
circular dependency (new protobuf depends on new upb, which depends on
new protobuf for codegen).
- some protobuf and upb bazel rules are now aliases, so `
extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py`
had to be modified to be able to follow aliases and reach the actual
aliased targets.
- some protobuf public headers were renamed, so especially
`src/compiler` needed to be updated to use the new headers.
- protobuf and upb now both depend on utf8_range project, so since we
bundle upb with grpc in some languages, we now have to bundle utf8_range
as well (hence changes in build for python, PHP, objC, cmake etc).
- protoc now depends on absl and utf8_range (previously protobuf had
absl dependency, but not for the codegen part), so python's
make_grpcio_tools.py required partial rewrite to be able to handle those
dependencies in the grpcio_tools build.
- many updates and fixes required for C++ distribtests (currently they
all pass, but we'll probably need to follow up, make protobuf's and
grpc's handling of dependencies more aligned and revisit the
distribtests)
- bunch of other changes mostly due to overhaul of protobuf's and upb's
internal build layout.

TODOs:
- [DONE] make sure IWYU and clang_tidy_code pass
- create a list of followups (e.g. work to reenable the few tests I had
to disable and to remove workaround I had to use)
- [DONE in cl/523706129] figure out problem(s) with internal import

---------

Co-authored-by: Craig Tiller <ctiller@google.com>
2023-04-12 18:43:58 +02:00
AJ Heller ca92648aa3
Revert "[test] Enable EventEngine experiments for Posix end2end tests." (#32855)
Reverts grpc/grpc#32844. CI revealed multiple EventEngine issues
overnight.
2023-04-12 09:20:30 -07:00
AJ Heller b16bf18bc3
[test] Enable EventEngine experiments for Posix end2end tests. (#32844)
This enables the EventEngine experiments in end2end tests, excluding the
ResourceQuota tests which have known failures.

Some Windows tests are hanging, so they will be enabled later.

---------

Co-authored-by: drfloob <drfloob@users.noreply.github.com>
2023-04-11 16:43:50 -07:00
Craig Tiller 4a4e2889a1
[promises] Disable C++ e2e tests with server_promise_based_call for now (#32831)
<!--

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-07 10:13:20 -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