Commit Graph

7702 Commits

Author SHA1 Message Date
Craig Tiller 4f444aaabf
Revert "[gprpp] Add ValidationErrors::message retrieval" (#32767)
Reverts grpc/grpc#32761
2023-03-31 21:42:58 -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
Stan Hu 4110dea333
[HTTP Proxy] Support CIDR blocks in `no_proxy` config (#31119)
This commit adds support for using CIDR blocks defined in the `no_proxy`
environment variable. For example:

```
http_proxy=http://localhost:8080 no_proxy=10.10.0.0/24
```

The example above would bypass the proxy if the server IP matched
10.10.0.0 - 10.10.0.255.

Closes #22681

---------

Co-authored-by: Yash Tibrewal <yashkt@google.com>
2023-03-30 23:43:36 -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
Mark D. Roth 3a8f499645
[JSON] Rename some accessor methods for consistency (#32740)
A bit of cleanup in preparation for making this a public API.
2023-03-30 07:13:15 -07:00
Craig Tiller e5770cd65c
[filter-test] Mark test only (#32752)
<!--

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-29 14:16:04 -07:00
Craig Tiller 2cd1501ca5
[promises] Filter unit test framework (#32110)
Built atop #31448 

Offers a simple framework for testing filters.

<!--

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-03-28 21:53:14 -07:00
Craig Tiller db3daf567b
[api-fuzzer] Enable fuzzing over config vars (#32736)
Add the capability for api-fuzzer to fuzz over different config
variables, to enable us to spot incompatible configurations there
sooner.

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-03-28 16:18:12 -07:00
apolcyn 4b46dbc19e
XDS: enable XDS federation by default (#32711)
Integration tests have been green so let's enable this (verification of
test results in https://b.corp.google.com/issues/262593165#comment30).
2023-03-28 09:55:35 -07:00
Matthew Stevenson ea839de878
Allow configuring max concurrent ALTS handshakes based on an environment variable. (#32672)
The logic is straightforward: attempt to read the
`GRPC_ALTS_MAX_CONCURRENT_HANDSHAKES` environment variable and, if it
set to an integer, instantiate the handshake queues based on this
integer.

Based on go/grpc-alts-concurrent-handshake-cap.
2023-03-28 09:53:46 -07:00
Craig Tiller 175ccc3a90
Reland global config changes (#32661)
<!--

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-03-27 18:55:24 -07:00
Craig Tiller a363b6c001
[fuzzing] Implement endpoints for FuzzingEventEngine (#32689)
Implement listeners, connection, endpoints for `FuzzingEventEngine`.
Allows the fuzzer to select write sizes and delays, connection delays,
and port assignments.

I made a few modifications to the test suite to admit this event engine
to pass the client & server tests:
1. the test factories return shared_ptr<> to admit us to return the same
event engine for both the oracle and the implementation - necessary
because FuzzingEventEngine forms a closed world of addresses & ports.
2. removed the WaitForSingleOwner calls - these seem unnecessary, and we
don't ask our users to do this - tested existing linux tests 1000x
across debug, asan, tsan with this change

Additionally, the event engine overrides the global port picker logic so
that port assignments are made by the fuzzer too.

This PR is a step along a longer journey, and has some outstanding
brethren PR's, and some follow-up work:
* #32603 will convert all the core e2e tests into a more malleable form
* we'll then use #32667 to turn all of these into fuzzers
* finally we'll integrate this into that work and turn all core e2e
tests into fuzzers over timer & callback reorderings and io
size/spacings

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-03-27 17:43:47 -07:00
Yousuk Seung 16c03db9ac
Revert "Revert "WRR: Support EPS" (#32723)" (#32725)
This reverts commit 7bd9267f32.




<!--

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-27 16:49:50 -07:00
Alisha Nanda 19d06a78ec
Add random early rejection for metadata (#32600)
(hopefully last try)

Add new channel arg GRPC_ARG_ABSOLUTE_MAX_METADATA_SIZE as hard limit
for metadata. Change GRPC_ARG_MAX_METADATA_SIZE to be a soft limit.
Behavior is as follows:

Hard limit
(1) if hard limit is explicitly set, this will be used.
(2) if hard limit is not explicitly set, maximum of default and soft
limit * 1.25 (if soft limit is set) will be used.

Soft limit
(1) if soft limit is explicitly set, this will be used.
(2) if soft limit is not explicitly set, maximum of default and hard
limit * 0.8 (if hard limit is set) will be used.

Requests between soft and hard limit will be rejected randomly, requests
above hard limit will be rejected.
2023-03-27 14:13:20 -07:00
Craig Tiller 8d2f70d53c
Reland "[promises] Convert call to a party" (#32651)" (#32653)
<!--

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-03-27 14:02:36 -07:00
Esun Kim 7bd9267f32
Revert "WRR: Support EPS" (#32723)
Reverts grpc/grpc#32657
2023-03-27 11:53:17 -07:00
Craig Tiller f9085e4496
[chttp2] Fix fuzzer found flow control error (#32716)
Previously we triggered a flow control update when `announced <
target/2`, but if `target==1` then we fail to send a flow control update
(announced is never less than 1/2==0) and break our forward progress
guarantees.

b/259780449 internally.
2023-03-26 21:31:02 -07:00
Yousuk Seung 4429066516
WRR: Support EPS (#32657)
<!--

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-24 16:23:51 -07:00
Jin c3bd5e9a1e
fix: gRPC: Remove AWS URL validation (#32674)
As of adding support in future for TPC support. We removed all url
validations from Credentials.
AWS url validation doesn't make sense here either.
2023-03-24 16:22:22 -07:00
Craig Tiller bdaf604f1b
[chttp2] Fix fuzzer found crash (#32696)
<!--

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-24 09:56:37 -07:00
Yash Tibrewal fcff4bd1d0
Gcp Observability Logging: The Call ID should use a UUIDv4 format (#32699)
Earlier, we were simply using a 64 bit random number, but the spec
actually calls for UUIDv4.

<!--

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-23 19:07:13 -07:00
AJ Heller 3fe678e306
[EventEngine] Add EventEngine::*Handle equality operators (#32695)
This allows us to replace `absl::optional<TaskHandle>` with checks
against the invalid handle.

This PR also replaces the differently-named invalid handle instances
with a uniform way of accessing static invalid instances across all
handle types, which aids a bit in testing.
2023-03-23 15:31:24 -07:00
Craig Tiller bca85495d4
[event_engine] Add a maximally threaded event engine wrapper (#32691)
Add an event manager that spawns threads just as much as it possibly
can... to expose TSAN to the myriad thread ordering problems in our code
base.

Next steps for this will be to add a new test mode for tsan + thready
event engine + a few other doodads to increase threads in the system
(party.cc in particular has a good place for a hook).

<!--

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-03-23 11:37:20 -07:00
Gregory Cooke a4f345ff96
TlsCreds: Support revocation of intermediate in chain. (#32544)
This PR is a small code change with a lot of new test data.
[In OpenSSL, there are two flags that configure CRL checks. Coping
relevant
section:](https://www.openssl.org/docs/man1.0.2/man3/X509_VERIFY_PARAM_get_depth.html)

> - X509_V_FLAG_CRL_CHECK enables CRL checking for the certificate chain
leaf certificate. An error occurs if a suitable CRL cannot be found.
> - X509_V_FLAG_CRL_CHECK_ALL enables CRL checking for the entire
certificate chain.

We currently only set `X509_V_FLAG_CRL_CHECK`, so we will only ever
check if the leaf certificate is revoked. We should check the whole
chain. I am open to making this a user configuration if we want to do it
that way, but we certainly need to be able to check the whole chain.

So, this PR contains the small code change in
`ssl_transport_security.cc` to use the `X509_V_FLAG_CRL_CHECK_ALL` flag.
Then the rest of the changes are in tests. I've added all the necessary
files to have a chain built that looks as follows
`Root CA -> Revoked Intermediate CA -> Leaf Certificate`, and added a
test for this case as well.
You can verify that on master this new test will fail (i.e. the
handshake will succeed even though the intermediate CA is revoked) by
checking out this branch, running `git checkout master --
./src/core/tsi/ssl_transport_security.cc`, then running the test.

I also slightly reorganized test/core/tsi/test_creds/ so that the CRLs
are in their own directory, which is the way our API intends to accept
CRLs.
2023-03-23 11:34:59 -04:00
Yash Tibrewal 625b3544e7
writes_per_rpc_test: TSAN data race fix (#32688)
Fixing TSAN data races of the kind -
https://source.cloud.google.com/results/invocations/c3f02253-0d0b-44e6-917d-07e4bc0d3d62/targets/%2F%2Ftest%2Fcpp%2Fperformance:writes_per_rpc_test@poller%3Dpoll/log

I think the original issue was the non-atomic load in
writes_per_rpc_test.cc but also making the change to use barriers
instead of relaxed atomics (probably unimportant but I'll prefer safety
in the absence of otherwise comments).

Could probably also use std::atomic but feeling a bit lazy to make the
changes throughout.

<!--

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-22 19:15:25 -07:00
Carl Lundin 87818f60fe
AWSCredentials: fix interaction with metadata server (#32532)
* No need to call metadata server if environment variables are set.
* AWS_SESSION_TOKEN is optional.
2023-03-22 15:05:23 -07:00
Jan Tattermusch 0c1797cd9f
Revert "[config] Move global config alongside core configuration" (#32659)
Reverts grpc/grpc#30788

(it breaks grpc_objc_bazel_test (see
https://github.com/grpc/grpc/pull/30788#issuecomment-1476372187) and
also seems to be breaking some other internal stuff).
2023-03-20 08:22:29 -07:00
Craig Tiller b7a83305e6
[config] Move global config alongside core configuration (#30788)
This is a big rewrite of global config.

It does a few things, all somewhat intertwined:
1. centralize the list of configuration we have to a yaml file that can
be parsed, and code generated from it
2. add an initialization and a reset stage so that config vars can be
centrally accessed very quickly without the need for caching them
3. makes the syntax more C++ like (less macros!)
4. (optionally) adds absl flags to the OSS build

This first round of changes is intended to keep the system where it is
without major changes. We pick up absl flags to match internal code and
remove one point of deviation - but importantly continue to read from
the environment variables. In doing so we don't force absl flags on our
customers - it's possible to configure grpc without the flags - but
instead allow users that do use absl flags to configure grpc using that
mechanism. Importantly this lets internal customers configure grpc the
same everywhere.

Future changes along this path will be two-fold:
1. Move documentation generation into the code generation step, so that
within the source of truth yaml file we can find all documentation and
data about a configuration knob - eliminating the chance of forgetting
to document something in all the right places.
2. Provide fuzzing over configurations. Currently most config variables
get stashed in static constants across the codebase. To fuzz over these
we'd need a way to reset those cached values between fuzzing rounds,
something that is terrifically difficult right now, but with these
changes should simply be a reset on `ConfigVars`.

<!--

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-03-17 16:56:45 -07:00
Yash Tibrewal 29ce6463d1
Revert "[promises] Convert call to a party" (#32651)
Reverts grpc/grpc#32359
2023-03-17 12:36:19 -07:00
Craig Tiller ed0ebb837e
[promises] A few tweaks to poll (#32588)
Looking for something else I made some test additions, code tweaks to
make `Poll<>` better.

<!--

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-16 22:02:27 -07:00
Craig Tiller a9873e8357
[promises] Convert call to a party (#32359)
<!--

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-03-16 01:09:53 -07:00
Yash Tibrewal 5029af9578
OpenCensus: Use new CallTracer interfaces (#32618)
This change mostly aims to get OpenCensus to use the new
ServerCallTracer interface. Note that the interfaces nor the code are in
their final states. There are a bunch of moving pieces, but I thought
this might be a nice mid-step to check-in and make sure that our
internal traces can also work with these changes.

Overall changes -
1) call_tracer.h shows what the hierarchy of new call tracer interfaces
looks like. Open to renaming suggestions.
2) Moved most of the common interface between `CallAttemptTracer` and
`ServerCallTracer` into a common `CallTracerInterface`. We should be
able to eventually move `RecordReceivedTrailingMetadata` and `RecordEnd`
as well to these common interfaces, but it requires some additional
work.
3) The compression filter is now responsible for recording the recv and
send messages for both the subchannel call and the server, and adds in
ability to record compressed and decompressed messages as well.
4) The OpenCensus server filter now uses the new `ServerCallTracer`
interface, and so doesn't need to be a filter anymore.
5) A new ServerCallTracerFilter was added. Ideally, we should be able to
move it to the current connected filter, but it is in a bit of an
interesting state right now, so I would prefer making those changes in a
separate PR with Craig's eyes on it.
6) A new context element `GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE`
was created that replaces the old `GRPC_CONTEXT_CALL_TRACER`, and the
new `GRPC_CONTEXT_CALL_TRACER` is mainly to pass the `CallAttemptTracer`
down the stack. This should go away in the new promise-based world.



<!--

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.

-->

<!-- Reviewable:start -->
- - -
This change is [<img src="https://reviewable.io/review_button.svg"
height="34" align="absmiddle"
alt="Reviewable"/>](https://reviewable.io/reviews/grpc/grpc/32618)
<!-- Reviewable:end -->
2023-03-15 22:39:41 -07:00
apolcyn e97f632886
[testing] make error check in log_too_many_open_files_test portable (#32595)
The error message for EMFILE is different on Musl, so this test is
currently broken portability tests on Musl:
https://source.cloud.google.com/results/invocations/d742bd83-bd28-49a3-b64a-442d0667231e/targets/github%2Fgrpc%2Frun_tests%2Fcpp_linux_dbg_native_x64_gcc_musl/tests
2023-03-13 13:47:32 -07:00
Craig Tiller 62bb99d163
[e2e] c++-ify core e2e test fixtures (#32550)
A step toward #14016.

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-03-10 10:39:56 -08:00
Yash Tibrewal 9551e3ef5a
Add ServerCallTracer interfaces (#32555)
<!--

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-10 10:08:49 -08:00
apolcyn d47b569330
[testing]: remove server-side check on number of concurrent RPCs in alts_concurrent_connectivity_test (#32585)
This check only works if all handshake RPCs have an OK status, and it's
racey e.g. if the client is cancelling handshake RPCs (being when an RPC
is cancelled, termination of the RPC at the client is asynchronous from
termination at the server, so the client can resume the queue before the
server RPC completes).
2023-03-09 18:02:48 -08:00
AJ Heller febed5121a
[EventEngine] Skip pathological iomgr test on Windows experiments (#32569)
With iomgr, this test is effectively rate limited by ExecCtx and the
single thread running pollset_work, which results in thousands of tiny
writes happening before every read. A small set of _synchronous_ 8k
reads then dominate the read-side of the test. This is an efficient
balance.

With the Windows EventEngine, the fully asynchronous, multi-threaded
reads and writes end up alternating roughly 1:1, meaning that a read
callback is executed for every tiny handful of bytes, tens of thousands
of times. Compared to the Posix EventEngine, without things like TCP_INQ
and/or recvmsg's timeout, I don't know of any great signal for how much
data can safely be received in a batch (e.g., we don't want to wait for
data that will never come, and we don't want to run callbacks for 2
bytes over and over again if we have KB in the pipe).

I believe the Windows EventEngine is WAI. I can significantly improve
this test performance by artificially slowing the reader down (adding a
>= 1ms sleep), but I believe that improves this use case to the
detriment of all others.
2023-03-08 19:50:44 -08:00
Yash Tibrewal 657c1da1b0
HttpProxyMapperTest: cleanup (#32572)
<!--

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-08 16:05:46 -08:00
Jin 89980d01f6
feat: Auth lib: Remove 3PI config url validation (#32450)
To support TPC feature for BYOID (3PI), we need to remove the validation
the pattern of impersonation endpoints, sts endpoints and token info
endpoints since they are different in TPC regions.

A security review is already passed at b/261634871

<!--

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-08 16:02:49 -08:00
AJ Heller 2cdc98a614
[EventEngine] Enable the client experiment for all h2_full end2end tests (#32568) 2023-03-08 13:11:05 -08:00
Gregory Cooke ca9e365002
Added verified_root_cert_subject pass up through cpp api (#32335)
PR #32215 added the verified root cert subject to the lower level
`tsi_peer`. This PR is a companion to that and completes the feature by
bubbling the information up to the `TsiCustomVerificationCheckRequest`
which is part of the user facing API for implementing custom
verification callbacks.
2023-03-08 13:41:26 -05:00
AJ Heller 1548038a09
[EventEngine] Windows endpoints keep their EventEngines alive (#32560)
Discovered via `bazel test
--test_env=GRPC_EXPERIMENTS=event_engine_client
//test/core/iomgr:endpoint_pair_test`. CI experiments can be enabled
generally on Windows once a few fixes and improvements are completed.
2023-03-08 08:04:35 -08:00
apolcyn 27ee3913d1
[iomgr and EE logging] Log ERROR if socket() returns EMFILE on posix (#32204)
There are potentially surprising deployment bugs that can cause `EMFILE`
to be hit. For example, file descriptor limits can be easily reached if
- the round robin LB policy is used
- the load balancer hands out an assignment with a lot of backends
- using debian's default 1024 file descriptor limit.

To make such problems more apparent, we can pay special attention to
this error and log ERROR when it happens.

Related: b/265199104
2023-03-03 13:18:01 -08:00
Craig Tiller 0d7b34451a
[promises] Make Poll<T> its own type, not a variant<> (#32515)
Avoids some compilation problems on older MSVC's, opens the door for
some future optimizations.

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-03-02 17:40:56 -08:00
Craig Tiller 2485fa94bd
[chttp2] Fix fuzzer found bug (#32507)
<!--

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-01 09:17:49 -08:00
apolcyn 18d1341b94
c2p resolver test: override the XDS server address, point it to a fake server that immediatley closes the connection (#32499)
Alongside https://github.com/grpc/grpc/pull/32496, this makes this test
behave the same on all platforms.

FWIW, I verified this causes us to see the previous lock cycle problem
in https://github.com/grpc/grpc/pull/32491 on linux - originally that
lock cycle was only on mac, because of environmental differences between
mac and linux in CI.
2023-02-28 22:54:22 -08:00
AJ Heller 8f7cd1eeed
[EventEngine] WindowsEventEngine Listener v2 (#32488)
Continued from https://github.com/grpc/grpc/pull/32295 after landing the
cleanup and logging pieces separately.
2023-02-28 20:33:03 -08:00
AJ Heller e164ef7460
[EventEngine] Add Listener Bind-after-Start test (#32502)
This also alters changes the PosixEventEngine to return a failure status
instead of crashing.

cc @yijiem
2023-02-28 18:30:53 -08:00
Craig Tiller 292d0a55aa
[metadata] Get logging to work safely (#32343)
This compiles for //:grpc, but not for tests yet.

It's the right approach though - @veblush hoping this is something you
can pick up and finish off.

<!--

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-02-28 16:14:39 -08:00