Commit Graph

13932 Commits

Author SHA1 Message Date
Craig Tiller dc41f42073
[promises] Add some status-like types for TrySeq (#34906)
`StatusFlag` acts like a status, but is just a boolean (we don't want to
accidentally treat a boolean as something that indicates failure in case
it's not)

Similarly `ValueOrFailure` looks like `StatusOr` but reduces the failure
space to one value.

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-11-10 09:14:44 -08:00
Adam Cozzette 016ed921ce
[deps] Upgrade protobuf version to v25.0 (#34513)
This commit upgrades gRPC to protobuf v25.0 and makes some fixes to
account for upb changes. One major change is that upb has been merged
into the protobuf repo, so we can now drop the separate `@upb`
dependency. Another is that `.upb.c` files no longer exist and there are
new `.upb_minitable.h` and `.upb_minitable.c` files. The longer
filenames exceeded a Windows restriction, so to work around that I
renamed the `upb-generated` directory to just `upb-gen`, and likewise
for `upbdefs-generated`.
2023-11-10 00:11:09 -08:00
Yijie Ma 720d7a0653
[EventEngine] WindowsDNSResolver Implementation (#34400)
Design is documented at
[go/windows-dns-resolver-issue](http://go/windows-dns-resolver-issue)
(note that the design doc is slightly outdated regarding the shared
ownership model of the virtual socket that was implemented in
13bd2b404e).

Passed `//test/cpp/naming:resolver_component_tests_runner_invoker` and
`//test/cpp/naming:cancel_ares_query_test`:
```
C:\Users\yijiem\projects\grpc>bazel --output_base=C:\bazel6 test --dynamic_mode=off --verbose_failures --test_env=GRPC_EXPERIMENTS=event_engine_dns --test_env=GRPC_VERBOSITY=debug --test_env=GRPC_TRACE=cares_resolver --enable_runfiles=yes --nocache_test_results //test/cpp/naming:resolver_component_tests_runner_invoker
INFO: Analyzed target //test/cpp/naming:resolver_component_tests_runner_invoker (1 packages loaded, 8 targets configured).
INFO: Found 1 test target...
INFO: From Compiling src/core/lib/event_engine/windows/windows_engine.cc:
C:\bazel6\execroot\com_github_grpc_grpc\src/core/lib/channel/channel_args.h(287): warning C4312: 'reinterpret_cast': conversion from 'int' to 'void *' of greater size
Target //test/cpp/naming:resolver_component_tests_runner_invoker up-to-date:
  bazel-bin/test/cpp/naming/resolver_component_tests_runner_invoker.exe
INFO: Elapsed time: 230.374s, Critical Path: 228.54s
INFO: 9 processes: 2 internal, 7 local.
INFO: Build completed successfully, 9 total actions
//test/cpp/naming:resolver_component_tests_runner_invoker                PASSED in 221.2s

Executed 1 out of 1 test: 1 test passes.
```

```
C:\Users\yijiem\projects\grpc>bazel --output_base=C:\bazel6 test --dynamic_mode=off --verbose_failures --test_env=GRPC_EXPERIMENTS=event_engine_dns --test_env=GRPC_VERBOSITY=debug --test_env=GRPC_TRACE=cares_resolver --enable_runfiles=yes --nocache_test_results //test/cpp/naming:cancel_ares_query_test
INFO: Analyzed target //test/cpp/naming:cancel_ares_query_test (0 packages loaded, 0 targets configured).
INFO: Found 1 test target...
Target //test/cpp/naming:cancel_ares_query_test up-to-date:
  bazel-bin/test/cpp/naming/cancel_ares_query_test.exe
INFO: Elapsed time: 49.656s, Critical Path: 48.00s
INFO: 6 processes: 2 internal, 4 local.
INFO: Build completed successfully, 6 total actions
//test/cpp/naming:cancel_ares_query_test                                 PASSED in 43.0s

Executed 1 out of 1 test: 1 test passes.
```

<!--

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-11-09 14:22:31 -08:00
Alisha Nanda b0e0659bab
Revert "[experiments] Explicit requirement check" (#34911)
Reverts grpc/grpc#34880, needs to be cherry-picked in.
2023-11-09 11:23:58 -08:00
Craig Tiller f4219440c6
[server] Fix fuzzing detected memory leak (#34908) 2023-11-09 10:07:45 -08:00
Mark D. Roth c5c46a1640
[memory test] add benchmark for xDS channel with multiple addresses (#34902)
The plumbing is a little messy here, but I didn't see an obvious way to
improve it without a lot of work.
2023-11-09 07:25:44 -08:00
Craig Tiller 3964acc806
[promises] Add an intra-activity mutex type (#34824)
Modeled after mutexes in the Rust ecosystem: the mutex owns the data
provided, and acquisition of the mutex returns a handle with which to
manipulate that data.

This fits in nicely with the execution environment we've established
whereby we may want to pass the lock from lambda to lambda for some
time.

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-11-08 16:41:26 -08:00
Craig Tiller 88011e05f5
[experiments] Explicit requirement check (#34880)
Add a config to experiments & rollouts to allow dependent experiments to
be flagged.

We're getting past the point where it's possible to reason about which
experiments need to be turned off if we disable some other experiment,
and so this provides some additional rollout safety.

Can be specified in both experiments and rollouts: experiments.yaml
makes the most sense and we should default to it, but rollouts.yaml lets
us put dependencies between internal & external dependencies internally
and that's gonna be a little useful.

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-11-08 16:05:03 -08:00
nanahpang 1e15d00ec4
[chaotic-good] Add client transport error handling. (#34611)
This is a follow-up PR of #34191, which handles the error condition of
endpoints failed to write/read in chaotic-good client transport.

This PR needs to be merged after #34191.

<!--

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-11-08 14:42:20 -08:00
Vignesh Babu 77e9fe49aa
Revert "[security] Support a list of SSL ECs" (#34900)
Breaks internal tests
2023-11-08 14:05:02 -08:00
Yijie Ma d3828ebfbd
[Fork] Add ObjectGroupForkHandler fork-handling system (#33733)
<!--

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: Bradley Hess <bdhess@google.com>
Co-authored-by: AJ Heller <hork@google.com>
2023-11-07 17:48:13 -08:00
Mark D. Roth 1e111df8be
[grpclb_e2e_test] more test improvements and flake fixes (#34896)
- Fix deadlock in load reporting tests.
- Add timeout to `WaitForLoadReport()`. (Note: this required changing
from `grpc::internal::Mutex` and friends to `grpc_core::Mutex` and
friends.)
- Fix balancer stream shutdown machinery.
- Change `ServerThread` to be a class instead of a struct.
2023-11-07 14:47:15 -08:00
Mark D. Roth 8a000f45f8
[grpclb and fake resolver] clean up e2e tests and simplify fake resolver (#34887)
Changes to fake resolver:
- Add `WaitForReresolutionRequest()` method to fake resolver response
generator to allow tests to tell when re-resolution has been requested.
- Change fake resolver response generator API to have only one mechanism
for injecting results, regardless of whether the result is an error or
whether it's triggered by a re-resolution.

Changes to grpclb_end2end_test:
- Change balancer interface such that instead of setting a list of
responses with fixed delays, the test can control exactly when each
response is set.
- Change balancer impl to always send the initial LB response, as
expected by the grpclb protocol.
- Change balancer impl to always read load reports, even if load
reporting is not expected to be enabled. (The latter case will still
cause the test to fail.) Reads are done in a different thread than
writes.
- Allow each test to directly control how many backends and balancers
are started and the client load reporting interval, so that (a) we don't
waste resources starting servers we don't need and (b) there is no need
to arbitrarily split tests across different test classes.
- Add timeouts to `WaitForAllBackends()` functionality, so that tests
will fail with a useful error rather than timing out.
- Improved ergonomics of various helper functions in the test framework.

In the process of making these changes, I found a couple of bugs:
- A bug in pick_first, which I fixed in #34885.
- A bug in grpclb, in which we were using the wrong condition to decide
whether to propagate a re-resolution request from the child policy,
which I've fixed in this PR. (This bug probably originated way back in
#18344.)

This should address a lot of the flakes seen in grpclb_e2e_test
recently.
2023-11-06 14:42:43 -08:00
nanahpang 3869ef09a5
[chaotic-good] Add chaotic good client transport read (roll-forward) (#34806)
Roll forward #34657, which was reverted in #34761.  

Previous error in CMake:
```
[ RUN      ] ClientTransportTest.AddOneStreamMultipleMessages
unknown file: Failure

Unexpected mock function call - returning directly.
    Function call: Call(CANCELLED: )
Google Mock tried the following 1 expectation, but it didn't match:

/[var/local/git/grpc/test/core/transport/chaotic_good/client_transport_test.cc:484](https://cs.corp.google.com/piper///depot/google3/var/local/git/grpc/test/core/transport/chaotic_good/client_transport_test.cc?l=484): EXPECT_CALL(on_done, Call(absl::OkStatus()))...
  Expected arg #0: is equal to OK
           Actual: CANCELLED: 
         Expected: to be called once
           Actual: never called - unsatisfied and active

/[var/local/git/grpc/test/core/transport/chaotic_good/client_transport_test.cc:484](https://cs.corp.google.com/piper///depot/google3/var/local/git/grpc/test/core/transport/chaotic_good/client_transport_test.cc?l=484): Failure
Actual function call count doesn't match EXPECT_CALL(on_done, Call(absl::OkStatus()))...
         Expected: to be called once
           Actual: never called - unsatisfied and active

real 0.24
user 0.00
sys 0.00

2023-10-20 01:50:32,776 FAILED: cmake/build/client_transport_test --gtest_filter=ClientTransportTest.AddOneStreamMultipleMessages  GRPC_POLL_STRATEGY=epoll1 [ret=139, pid=1663532, time=0.3sec]
```
<!--

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-11-06 12:24:06 -08:00
Luwei Ge 1dbbdb5820
[TSI] not configure SNI if it looks like an IP address (#34878)
IP addressed are not allowed as host names. So we want to ignore the
given server_name_indication when it looks like an IP.
2023-11-06 12:22:24 -08:00
Mark D. Roth 1324ce42ea
[pick_first] fix race condition for detecting idleness (#34885)
This fixes a bug accidentally introduced in #33753. The symptom is that
if we exit idle and then get a new address list before any of the
subchannels in the old list can report their initial connectivity state,
we will incorrectly ignore the new address list.
2023-11-06 10:05:16 -08:00
Craig Tiller 78825f79ca
[event-engine] Fix channelz tests to hermetically clean up callbacks (#34883)
EventEngine experiments, especially with `work_serializer_dispatch` tend
to cause callbacks to occur later than we've previously seen, so tests
that verify global data structures tend to become flakier when these are
introduced.

Here, the fix is waiting for EventEngine to be closed before starting
the new test.

Whilst here, make some adjustments to the test for better readability on
what's going on:
- if we fail a request to an echo service, we do not actually expect the
messages to match, so don't report that
- if we expect a value of 1 or 2, AnyOf is a better tool: it will report
the actual value too

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-11-06 07:00:04 -08:00
Luwei Ge eaa72802a0
[security] Support a list of SSL ECs (#34867)
Addresses #23235
2023-11-03 14:17:28 -07:00
Gregory Cooke 0d4e1ef5df
[Security - Revocation] Crl Directory Watcher Implementation (#34749)
This adds the directory reloader implementation of the CrlProvider. This
will periodically reload CRL files in a directory per [gRFC
A69](https://github.com/grpc/proposal/pull/382)

Included in this is the following:
* A public API to create the `DirectoryReloaderCrlProvider`
* A basic directory interface in gprpp and platform specific impls for
getting the list of files in a directory (unfortunately prior C++17,
there is no std::filesystem, so we have to have platform specific impls)
* The implementation of `DirectoryReloaderCrlProvider` takes an
event_engine and a directory interface. This allows us to test using the
fuzzing event engine for time mocking, and to implement a test directory
interface so we avoid having to make temporary directories and files in
the tests. This is notably not in `include`, and the
`CreateDirectoryReloaderCrlProvider` is the only way to construct one
from the public API, so we don't expose the event engine and directory
details to the user.

---------

Co-authored-by: gtcooke94 <gtcooke94@users.noreply.github.com>
2023-11-03 20:48:05 +00:00
apolcyn 2e205d8fbf
[csharp] Attempt to fix download flakes in C# distrib tests (#34854)
Attempt to fix
https://source.cloud.google.com/results/invocations/46cb13f1-7532-4c37-af5d-40e013dafc4c/targets/%2F%2Ftools%2Fbazelify_tests%2Ftest:distribtest_csharp_linux_x64_ubuntu2204/log
flakes

Fix taken from https://github.com/dotnet/runtime/issues/27792
2023-11-03 13:18:14 -07:00
Matthew Stevenson 52f9e011f3
[tls] Allow skipping server cert verification when no default roots are present. (#34859)
This PR fixes a bug identified in #29667, where the TLS channel
credentials still require a trust bundle even if the user has explicitly
opted to not verify the server certificate. This PR is based on #29810.
2023-11-03 10:23:10 -07:00
Gregory Cooke 0b1e381d56
[Security] Fix bug for layered composite creds (#34860)
Address https://github.com/grpc/grpc/issues/12554

The API for `duplicate_without_call_credentials` says 
```
// Creates a version of the channel credentials without any attached call
// credentials. This can be used in order to open a channel to a non-trusted
// gRPC load balancer.
```

As the impl stands right now, because of that description, in the case
of layered composite creds, I think the right behavior would be to call
down until you get the base cred with no call cred.

In discussing with the team, we do wonder if the use-case of layered
composite creds is really something that should be a feature, or if we
should be checking during the creation of composite creds to make sure
we aren't layering composite creds? @markdroth can you give your
thoughts?
2023-11-03 10:34:18 -04:00
Stanley Cheung ff2c0313e3
[PSM Interop] Add flag to enable CSM Observability in c++ image (#34866)
Roll forward of #34832, 3rd attempt. Will run a grpc import cherry-pick
to make sure the next import is going to be clean.
2023-11-02 14:59:16 -07:00
Stanley Cheung 9303b86010
Revert "[PSM Interop] Add flag to enable CSM Observability in c++ image" (#34858)
Reverts grpc/grpc#34840
2023-11-02 10:42:07 -07:00
Stanley Cheung a62c2607a6
[PSM Interop] Add flag to enable CSM Observability in c++ image (#34840)
Roll forward of #34832 (reverted in #34837).

Need #34836 to be  merged first.
2023-11-01 18:52:57 -07:00
AJ Heller 1566fa42f4
[build] Exclude end2end experiment variations from distribtests (#34850) 2023-11-01 13:53:20 -07:00
AJ Heller c85cdfe656
[test] Fix http_proxy end2end test fixture (#34838)
Built upon @Vignesh2208 's work in #33156

This adds ref counting to the http_proxy fixture object, fixing test
flakes identified by the introduction of EventEngine listeners. Proxy
objects were either being deleted twice, or sometimes not at all,
resulting in two different sorts of flakes.
2023-11-01 12:13:28 -07:00
Vignesh Babu c4b9a9a8fc
Revert "[PSM Interop] Add flag to enable CSM Observability in c++ image" (#34837)
Reverts grpc/grpc#34832. Broke import
2023-10-31 18:27:29 -07:00
Stanley Cheung 433cfa99a5
[PSM Interop] Add flag to enable CSM Observability in c++ image (#34832)
Add the flag `enable_csm_observability` to the c++ PSM interop testing
image, such that when enabled from the PSM interop testing framework,
the C++ client/server app will enable the CSM Observability plugin.
2023-10-31 14:42:51 -07:00
Mark D. Roth e8f2e27b2c
[memory test] reland: add benchmarks with xDS enabled (#34820)
Relands #34785, which was reverted in #34818.

The first commit is the revert. The second commit removes the gtest
dependency from the xds_server library, which should address the
testonly problem internally.
2023-10-31 12:56:40 -07:00
Luwei Ge 2fdcba26dd
[ALTS] Create GsecKeyInterface and related classes in ALTS (#34814)
As such, `alts_zero_copy_grpc_protector_create` will take a
`GsecKeyFactoryInterface` to create `GsecKeyInterface` objects for the
underlying crypter to use.

This enables the caller to control how all the key related buffers are
prepared and protected.

`gsec_aes_gcm_aead_crypter` holds the raw pointer to `GsecKeyInterface`
instead of a `unique_ptr` possibly because somewhere in the test (and
maybe production code as well), the structure is getting copied. A SEGV
error would be caused with `unique_ptr` which doesn't support copy
operations.
2023-10-31 10:58:19 -07:00
Yash Tibrewal 609e96446a
[http2] Only run http2_stats test if http2_stats_fix experiment is enabled (#34833) 2023-10-31 10:26:11 -07:00
Craig Tiller 54f65e0dbd
[work-serializer] Isolate test event engines (#34831)
Previously event engines could exist past test boundaries, which messed
up stats collection in later tests.
2023-10-30 16:08:28 -07:00
Craig Tiller b7b75fca3f
[server-fuzzer] Fix behavior on failed transport creation (#34827) 2023-10-30 13:56:58 -07:00
Craig Tiller c2f49c2d3b
[promises] Fix some behaviors exposed by api_fuzzer (#34795)
1. we shouldn't spawn multiple promises to deal with cancellations (one
is enough)
2. lame_client needs to express that it will never read a message
2023-10-29 09:54:07 -07:00
Craig Tiller b38e7ab88e
[server] Reland cap size of pending request queue with RealRequestMatcher (#34809)
fix in ee787e8955
2023-10-27 17:07:57 -07:00
Mark D. Roth b1901eb732
Revert "[memory test] add benchmarks with xDS enabled" (#34818)
Reverts grpc/grpc#34785
2023-10-27 15:25:43 -07:00
AJ Heller 8224278983
[test] Fix bad server response test race (#34816)
Fixes two issue with the `event_engine_listener` experiment:
* a race in `on_connect` with the read/write path
* a long delay due to pollset_work being effectively a `sleep` in the
EventEngine shim implementation
2023-10-27 22:17:10 +00:00
Mark D. Roth e0a5190a5e
[memory test] add benchmarks with xDS enabled (#34785)
Initial results:

```
default: call/client: 15038.38208
default: call/server: 12873.64608
default: call/xds_client: 15850.04544
default: call/xds_server: 13177.15968
default: channel/client: 27747.9424
default: channel/server: 19939.328
default: channel/xds_client: 45272.2688
default: channel/xds_server: 20805.632
```

b/297028827
2023-10-27 13:52:05 -07:00
Matthew Stevenson 07985907f2
[tls] Fix ownership bugs in TlsCredentialsOptions and grpc_tls_credentials_options. (#34758)
Currently it is very easy to use the `TlsCredentialsOptions` in such a
way that it produces a memory leak. For example, the code block
```
{
  TlsCredentialsOptions options;
}
```
produces a memory leak. This PR fixes up the ownership bugs in this
class and its `grpc_tls_credentials_options`, the C-core analogue.
2023-10-27 08:09:04 -07:00
Mark D. Roth 4826efa619
[pick_first] fix happy eyeballs address interleaving bug (#34804)
The original logic from #34615 was incorrect in cases where one address
family has a different number of addresses than the other(s).

Fixes b/307937051.
2023-10-26 12:53:31 -07:00
Mark D. Roth 9c15d6327e
Revert "[server] Cap size of pending request queue with RealRequestMatcher" (#34803)
Reverts grpc/grpc#34782
2023-10-26 09:54:14 -07:00
Yash Tibrewal a5b963ada7
[http2] Fix calculation of framing_bytes for http2_stats_test (#34799) 2023-10-25 19:32:00 -07:00
Yash Tibrewal 6b691cddcc
[http2] Fix http2_stats test for promises experiment (#34797)
Fixes http2_stats_test for server promises experiment
2023-10-25 17:12:35 -07:00
Craig Tiller f09cd072fc
[server] Cap size of pending request queue with RealRequestMatcher (#34782)
Also break the filter stack and promise based versions apart so that I
can re-understand this code.

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-10-25 14:50:46 -07:00
AJ Heller 66d928c440
[EventEngine] Fix local work queueing logic with multiple pools (#34786)
This fixes a bug which could happen if multiple WorkStealingThreadPools
existed (wstpA and wstpB), and a thread in wstpA called
`wstpB->Run(closure)`. Previously, this would have scheduled the closure
on the current wstpA thread worker's local queue.

`bm_thread_pool` results look unchanged on RBE.
2023-10-24 17:27:45 -07:00
Yash Tibrewal a3f2e08202
[http2] Fix framing_bytes stat (#34787)
This stat is unused at present, so no need to protect it by an
experiment.
2023-10-24 12:45:02 -07:00
Mark D. Roth 066d5dd2bb
[xDS e2e tests] move xDS bootstrap and resource helpers into their own library (#34773)
This paves the way for reusing these helpers in a standalone xDS server
for memory usage tests.
2023-10-24 12:33:00 -07:00
AJ Heller 6f0feaa43f
[test] Delete stranded event test (#34784)
This was a regression test for epollex, which was deleted. It
consistently takes 9 to 12 minutes to run.
2023-10-24 11:23:47 -07:00
Craig Tiller 888a7e87cc
[fuzzing] Fix msan error in fuzzer (#34783) 2023-10-24 09:41:17 -07:00