Commit Graph

13604 Commits

Author SHA1 Message Date
Craig Tiller 7223a9e5fe
[fuzzing] Increase deadline (#33663)
Fix b/290886936
2023-07-12 10:31:39 -07:00
Craig Tiller 86d7c8125e
[fuzzing] Increase deadline (#33658)
Resolves b/290812157
2023-07-11 15:41:37 -07:00
Craig Tiller 8845e290db
[filter-test] Enhancements for better testing (#33652)
- Support call finalizers in filter test.
- Add an accessor to the filter implementation from the channel, so that
it can be interrogated by tests.
- Matcher to ensure that some metadata is *not* in a metadata batch

(functionality needed to support the additional testing we talked about
this morning)

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-07-11 15:27:27 -07:00
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
Vignesh Babu 974798a427
[tracing] Fix flakiness in tcp_posix_test (#33639)
tcp_posix_test is incorrectly assuming that all endpoint_writes with
timestamps enabled will be successfully traced. Remove the timestamps
checking related tests to prevent flakes when the test is enabled
internally.
2023-07-10 12:59:57 -07:00
Craig Tiller ed587f2b07
[hpack] Reduce parse table size in the rare case of a parse error (#33637)
Most of the time parsing succeeds, and only rarely do we see an error.

This change reduces the parse memento size from 120 bytes to 56 bytes.

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-07-10 11:21:51 -07:00
Craig Tiller dc5c99c9b4
[fuzzing] Increase deadline (#33600)
Similar pattern to many others.. increase this deadline to have the
fuzzer pass.

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-07-07 12:39:55 -07:00
Craig Tiller d3d4d5309d
[end2end] Fix fuzzer found deadline bug (#33633)
fix b/290140776
2023-07-07 09:43:35 -07:00
Craig Tiller cdfbb0ced7
[end2end] Fix fuzzer found deadline bug (#33629)
Fixes b/288888511
2023-07-07 09:43:11 -07:00
Craig Tiller e28729fe0a
[end2end] Fix fuzzer found deadline bug (#33630)
fix b/288965746
2023-07-07 09:42:48 -07:00
Craig Tiller f417da77a6
[end2end] Fix fuzzer found deadline bug (#33631)
fix b/288718007
2023-07-07 09:07:18 -07:00
Craig Tiller 4b7a360041
[end2end] Fix fuzzer found deadline bug (#33632)
fix b/289593034
2023-07-07 09:06:20 -07:00
nanahpang 0cc9d16e9c
[chaotic-good] Implement a promise-based endpoint for chaotic-good transport to read & write to EventEngine::Endpoint. (#33257)
This PR is continuing the work of prototyping in
https://github.com/grpc/grpc/pull/31592, and the design doc is at
[link](https://docs.google.com/document/d/1vRy0yse-d1heLQRmLPo_0figsTPXJAnNN84tBCAne_s/edit?pli=1&resourcekey=0-JvUPdq0LaZq8gMkgT9Pzlw#heading=h.qgvc5vr55ytg).

<!--

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-07-06 17:18:48 -07:00
Yash Tibrewal 9984f1bd5b
Revert "Revert "Revert "Revert "[HTTP2] Fix inconsistencies in keepalive configuration ( #33428)" (#33512)"" (#33601)
Reverts grpc/grpc#33599

Needs to be cherry-picked
2023-07-06 15:13:12 -07:00
Craig Tiller 08f1cc3ba8
[end2end] Explain failures a little better (#33621)
I'd been adding the following stanza regularly to debug flakes/fuzz
failures:

```
  Expect(1, CoreEnd2endTest::MaybePerformAction{[&](bool success) {
           Crash(absl::StrCat(
               "Unexpected completion of client side call: success=",
               success ? "true" : "false", " status=", server_status.ToString(),
               " initial_md=", server_initial_metadata.ToString()));
         }});
```

it was helpful because it indicated why a call batch finished
successfully and helped quickly identify next steps.

It occurred to me however that this would better be done inside of the
framework, and for *all* ops that have outputs, so this PR does just
that. Any time a batch with an op that outputs information finishes
successfully but unexpectedly we now display those outputs in human
readable form in the error message.

Sample output:
```
[ RUN      ] CorpusExamples/FuzzerCorpusTest.RunOneExample/0
RUN TEST: Http2SingleHopTest.SimpleDelayedRequestShort/Chttp2SimpleSslFullstack
E0101 00:00:05.000000000  396633 simple_delayed_request.cc:37]         Create client side call
E0101 00:00:05.000000000  396633 simple_delayed_request.cc:41]         Start initial batch
E0101 00:00:05.000000000  396633 simple_delayed_request.cc:47]         Start server
E0101 00:00:05.000000000  396633 cq_verifier.cc:364]                   Verify tag(101)- for 600000ms
test/core/end2end/cq_verifier.cc:316: Unexpected event: OP_COMPLETE: tag:0x1 OK
with:
  incoming_metadata: {}
  status_on_client: status=4 msg=Deadline Exceeded trailing_metadata={}
checked @ test/core/end2end/tests/simple_delayed_request.cc:51
expected:
  test/core/end2end/tests/simple_delayed_request.cc:50: tag(101) success=true
```
2023-07-06 14:31:13 -07:00
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
Craig Tiller c5bb43ab61
[chttp2] Eliminate grpc_chttp2_stream_map (#33503)
No need for a bespoke type anymore... and a step along the path to
C++ification.

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-07-05 15:07:31 -07:00
Yash Tibrewal c0889a4f23
[fuzz] Increase call timeout for retry_unref_before_recv (#33608)
Noticed this failing on an internal cl due to deadline exceeded errors.
<!--

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-07-05 14:38:32 -07:00
Craig Tiller 43f67d3640
[fuzzing] Allow hpack fuzzers to supply config (#33242)
<!--

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-07-05 14:20:47 -07:00
AJ Heller eb5c4da829
[EventEngine] Only use fork handlers when enabled via an environment variable (#33582)
Co-authored-by: drfloob <drfloob@users.noreply.github.com>
2023-07-05 13:01:51 -07:00
Vignesh Babu 63037989ca
[experiments] Add specification of different default values for different platforms. (#33543)
It introduces the following syntax:

The following would mark the experiment as broken on ios, false on
windows and debug on posix. If a platform is un-specified, the default
for that platform will be set to false. Refer to
test/core/experiments/fixtures/test_experiments_rollout.yaml for
examples which are tested.

- name: experiment_1
   default:
      &nbsp; ios: broken
      &nbsp; windows: false
      &nbsp; posix: debug
      
It also supports the already existing syntax and interprets it as just
specifying one default for all platforms.
    
Supported platform tags: ios, windows, posix
2023-07-05 10:36:37 -07:00
Esun Kim 415f2f9ee3
[Core] Improve HPACK (#33597) 2023-07-05 13:04:31 +09:00
Yash Tibrewal 523d9a2135
Revert "Revert "Revert "[HTTP2] Fix inconsistencies in keepalive configuration ( #33428)" (#33512)" (#33599)
Reverts grpc/grpc#33586

Looks like this has to be cherry-picked
2023-07-04 19:25:17 -07:00
Yash Tibrewal 8d9164fc16
Revert "Revert "[HTTP2] Fix inconsistencies in keepalive configuration ( #33428)" (#33512) (#33586)
Along with an experiment this time

<!--

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-30 16:27:30 -07:00
Bjorn Svensson ac874c2c83
[core] Add a channel argument to set DSCP on streams (#28322)
This adds a new channel argument `GRPC_ARG_DSCP` which allows users to
create classified gRPC streams with a
Differentiated Services Code Point (DSCP) marking on the IP frames.

The channel argument is handled on both clients and servers, but
currently only on posix based systems.

Fixes #17225

**Background**:
In addition to what is already described is #17225, when gRPC is used in
telco systems there is often a need to classify streams of importance.
There can be multiple hops between two endpoints (e.g. between 2 telecom
operators) and some streams that are more important than others (e.g.
emergency call related or similar). By marking the IP packets using DSCP
the aware routers can make a sound decision of the prioritization.

This PR propose to use DSCP as the configuration value since its common
for both IPv4/IPv6, an alternative would be to use a config name that
includes TOS and Traffic Class.
There might be more needed regarding documentation and end2end testing,
but there I need some advice.

**References**
https://datatracker.ietf.org/doc/html/rfc2474
https://www.iana.org/assignments/dscp-registry/dscp-registry.xhtml

<!--

Your pull request will be routed to the following person by default for
triaging.
If you know who should review your pull request, please remove the
mentioning below.

-->

@yashykt
2023-06-30 16:10:21 -07:00
Eugene Ostroukhov e0bc8a2c85
[xDS LB] xDS pick first support (#33540) 2023-06-30 14:06:08 -07:00
Mark D. Roth 15db5cd16a
[resolvers] use proper %-encoding of authority by default (#33571)
- Change the `ResolverFactory::GetDefaultAuthority()` method to %-encode
the authority by default, so individual resolver impls don't need to
remember to do this.
- Remove the hack in the xds resolver for setting the authority to
everything after the last `/` character.
- Change the `unix`, `unix-abstract`, and `vsock` resolvers to use a
real authority instead of hard-coding to "localhost".
2023-06-29 13:00:03 -07:00
Vignesh Babu bf3ffcf600
[experiments] A unit test for the experiments framework (#33334)
Adds a test for the experiments codegen. It updates the codegen to parse
test_experiments.yaml and test_experiments_rollouts.yaml files and
generate test_experiments.h and test_experiments.cc files along with an
experiments_test.cc file. The experiments test verifies the returned
value of IsExperimentEnabled with the expected value.
2023-06-29 12:21:11 -07:00
Matthew Stevenson 278978d6f0
[tls] Remove use of SSL_CTX_set_client_CA_list for TLS server credentials. (#33558)
This PR does the following: for the TLS server credentials, stops
calling `SSL_CTX_set_client_CA_list` by default in
`ssl_transport_security.cc`, and gives users a knob to re-enable calling
this API.

## What does the `SSL_CTX_set_client_CA_list` API do?

When this API is called, a gRPC TLS server sends the following data in
the ServerHello: for each certificate in the server's trust bundle, the
CA name in the certificate.

This API does not change the set of certificates trusted by the server
in any way. Rather, it is just providing a hint to the client about what
client certificate should be sent to the server.

## Why are we removing the use of `SSL_CTX_set_client_CA_list` by
default for the TLS server credentials?

Removing the use of this API by default has 2 benefits:
1. Calling this API makes gRPC TLS unusable for servers with a
sufficiently large trust bundle. Indeed, if the server trust bundle is
too large, then the server will always fail to build the ServerHello.
2. Calling this API is introducing a huge amount of overhead (1000s of
bytes) to each ServerHello, so removing this feature will improve
connection establishment latency for all users of the TLS server
credentials.
2023-06-29 09:48:15 -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
Mark D. Roth 38816cf327
[WRR] delegate to pick_first instead of creating subchannels directly (#33087)
As part of the dualstack backend design, change WRR to delegate to
pick_first instead of creating subchannels directly.
2023-06-27 14:20:57 -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 ababacd5fc
[xDS] fix fuzzer-found failure in ClusterSpecifierPlugin handling (#33552)
Fixes b/288542307.
2023-06-26 16:52:46 -07:00
Yijie Ma e3c22b944b
[Fuzzing] Fix use-after-free in resolver_fuzzer (#33553)
In FuzzingDNSResolver, capturing the engine as raw pointers in the
lambda functions instead of capturing the `this` pointer. By the time
the lambda is ran, the FuzzingDNSResolver might already be destroyed but
the engine should still be alive.


<!--

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-26 16:40:19 -07:00
Matthew Stevenson 4b55f22e6e
[alts] Remove ExecCtx check from alts_zero_copy_grpc_protector_create function. (#33494)
I'm fixing the ALTS/Envoy transport socket extension (which is currently
broken). Along the way, I'm trying to remove as many uses of gRPC
internals as possible (with the eventual goal of only relying on public
gRPC APIs and the alts_zero_copy_grpc_protector). To this end, I need to
remove the ExecCtx check in the alts_zero_copy_grpc_protector_create
function, so that Envoy can call into this function without needing to
create an ExecCtx.
2023-06-26 15:12:52 -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
Jan Tattermusch 1002319736
[csharp] reintroduce base_namespace experimental option to C# (with a patch) (#33535)
Reintroduces patched version of https://github.com/grpc/grpc/pull/32636
(which was reverted in https://github.com/grpc/grpc/pull/32957).

Together with cl/542843305, the internal build should work fine.

Supersedes https://github.com/grpc/grpc/pull/33310 (since a patch is
also needed).

---------

Co-authored-by: tony <tony.newell@pobox.com>
2023-06-26 11:20:26 +02:00
Hannah Shi c6e4a60f8f
[ObjC] run cf event engine test suit on ios (#33534)
Run cf event engine test suit on ios

CC: @sampajano  @mikefan1991
2023-06-25 20:11:56 +00: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
Yijie Ma 6e95cebbd0
[EventEngine] Simplify `EventEngine::DNSResolver` API (#33459)
This change simplifies `EventEngine::DNSResolver`'s API based on the
proposal:
[go/event-engine-dns-resolver-api-changes](http://go/event-engine-dns-resolver-api-changes).
Note that this API change + the implementation described in
[go/event-engine-dns-resolver-implementation](http://go/event-engine-dns-resolver-implementation)
has already been tested against our main test suites and are passing
them.


<!--

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-22 12:19:20 -07:00
Yash Tibrewal ba878c804d
Revert "[HTTP2] Fix inconsistencies in keepalive configuration (#33428)" (#33512)
This reverts commit e107ff5e99.




<!--

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 15:49:35 -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
Ben Beasley 011e1162c2
[Test] Use `ssl.SSLContext.wrap_socket`, not `ssl.wrap_socket` (#33492)
In the HTTP(S) test server in the core tests, use
`ssl.SSLContext.wrap_socket`, not `ssl.wrap_socket`. The latter emits a
`DeprecationWarning` since Python 3.10 and is [removed in Python
3.12](https://github.com/python/cpython/issues/94199).

This fixes the core tests (but not necessarily the `grpcio` tests) for
Python 3.12.

This is relevant to https://github.com/grpc/grpc/issues/33063.
2023-06-21 10:06:08 -07:00