Commit Graph

435 Commits

Author SHA1 Message Date
Mark D. Roth 6c08d36c3b [reorg] move telemetry code to src/core/telemetry (#36644)
Closes #36644

PiperOrigin-RevId: 636702732
2024-05-23 15:54:07 -07:00
Tanvi Jagtap 7ab3cebdfc [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - gpr_log (#36694)
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - gpr_log
In this CL we are migrating from gRPCs own gpr logging mechanism to absl logging mechanism. The intention is to deprecate gpr_log in the future.

We have the following mapping

1. gpr_log(GPR_INFO,...) -> LOG(INFO)
2. gpr_log(GPR_ERROR,...) -> LOG(ERROR)
3. gpr_log(GPR_DEBUG,...) -> VLOG(2)

Reviewers need to check :

1. If the above mapping is correct.
2. The content of the log is as before.
gpr_log format strings did not use string_view or std::string . absl LOG accepts these. So there will be some elimination of string_view and std::string related conversions. This is expected.

Closes #36694

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36694 from tanvi-jagtap:python_codegen_gpr_log 54ee362e3d
PiperOrigin-RevId: 636071998
2024-05-22 01:17:25 -07:00
AJ Heller b3e061e086 Pre-work for centralized trace flags
PiperOrigin-RevId: 635971487
2024-05-21 17:00:44 -07:00
Mark D. Roth 0944410d6c [reorg] move test/core/util -> test/core/test_util (#36446)
Closes #36446

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36446 from markdroth:reorg_test 5dcc85e006
PiperOrigin-RevId: 629229220
2024-04-29 17:06:40 -07:00
Tanvi Jagtap c8f85ff037 [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT (#36445)
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT
Replacing GPR_ASSERT with absl CHECK

These changes have been made using string replacement and regex.

Will not be replacing all instances of CHECK with CHECK_EQ , CHECK_NE etc because there are too many callsites. Only ones which are doable using very simple regex with least chance of failure will be replaced.

Given that we have 5000+ instances of GPR_ASSERT to edit, Doing it manually is too much work for both the author and reviewer.

<!--

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.

-->

Closes #36445

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36445 from tanvi-jagtap:tjagtap_assert_tools c160ab231a
PiperOrigin-RevId: 628093687
2024-04-25 09:08:38 -07:00
AJ Heller 1a8b22f2de [build] Restrict visibility for creating core credentials types. (#36216)
Closes #36216

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36216 from drfloob:conceal-core-cred-creation a44a299273
PiperOrigin-RevId: 625425746
2024-04-17 01:21:29 +00:00
Craig Tiller d1cb0c0874 [chaotic-good] Bring up core e2e tests (#35663)
Closes #35663

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35663 from ctiller:shush-e2e 0c1f82ed71
PiperOrigin-RevId: 605717663
2024-02-09 13:34:46 -08:00
Craig Tiller 2bb10be729 [experiments] Allow experiments to opt-in to testing against all pollers (default to not) (#35683)
Closes #35683

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35683 from ctiller:minimize2 ac22512f99
PiperOrigin-RevId: 601886350
2024-01-26 15:47:13 -08:00
Eugene Ostroukhov 2fc9dd1546 [build] Update `envoy-api` and `xds` dependencies (#35603)
Closes: #34966

Closes #35603

PiperOrigin-RevId: 600919492
2024-01-23 15:15:47 -08:00
Craig Tiller 9f6789e2b2 [chttp2] Rework settings management to be a c++ type (#35449)
Closes #35449

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35449 from ctiller:h2-settings f67e542a8b
PiperOrigin-RevId: 597970333
2024-01-12 15:21:05 -08:00
Craig Tiller 99cafa32d9 [promises] Expand maximum `Seq` length (#35423)
Closes #35423

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35423 from ctiller:seqqy fea10949d3
PiperOrigin-RevId: 595147939
2024-01-02 10:18:01 -08:00
Craig Tiller 75e5ebcb14 [promises] Add a switch primitive (#35424)
Remove the old `switch` library - this used to be an implementation detail of `Seq`, `TrySeq` - but has become unused.

Add a new user facing primitive `Switch` that fills a similar role to `switch` in C++ - selecting a promise to execute based on a primitive discriminator - much like `If` allows selection based on a boolean discriminator now.

A future change will optimize this to actually lower the `Switch` into an actual `switch` statement, but for right now I want to get the functionality in.

Closes #35424

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35424 from ctiller:switchy 5308a914c6
PiperOrigin-RevId: 595140965
2024-01-02 09:59:38 -08:00
Mark D. Roth c7101d0867 [xDS] move CDS and EDS watchers into xds resolver (#35011)
Implements gRFC A74 (https://github.com/grpc/proposal/pull/404).

Closes #35011

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35011 from markdroth:xds_watchers_in_xds_resolver a39f71f37f
PiperOrigin-RevId: 595134549
2024-01-02 09:20:06 -08:00
Craig Tiller 6d35000c17 [promises] Log errors in TrySeq (#35319)
When an error occurs in `TrySeq`, log the error.
Also, in the trace statements, capture the file/line that the sequence was constructed at, and log that with the traces.

Closes #35319

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35319 from ctiller:trace-seq bc0d47395f
PiperOrigin-RevId: 591999228
2023-12-18 13:49:50 -08:00
Craig Tiller c93798b5c7 Make gen_experiments.py runnable internally also
PiperOrigin-RevId: 591902705
2023-12-18 08:19:11 -08:00
Craig Tiller 8448d499e2 [promises] Add `AllOk` combinator (#35304)
`AllOk` runs a set of promises concurrently, and like `TryJoin` waits for them all to succeed or one to fail.
Unlike `TryJoin` it returns a single unified status of the composition, so cannot handle member promises that might return `StatusOr` or the like.

Closes #35304

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35304 from ctiller:all-review 30f5f809c6
PiperOrigin-RevId: 591031189
2023-12-14 13:21:35 -08:00
Craig Tiller 4e666c740b Internal change
PiperOrigin-RevId: 590780731
2023-12-13 20:06:30 -08:00
Tanvi Jagtap 8019903a44 Internal configuration cleanup
PiperOrigin-RevId: 590528536
2023-12-14 03:42:30 +00:00
Craig Tiller 399fded213 Reapply "[experiments] Explicit requirement check" (#34911) (#34915)
This reverts commit b0e0659bab.

Closes #34915

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/34915 from ctiller:requires2 8e4f033317
PiperOrigin-RevId: 583110606
2023-11-16 11:35:25 -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
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 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
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
Gregory Cooke 9969d820b5
[TLS - Revocation] Crl Provider (#34715)
This reverts commit 7af5efcfd3.
2023-10-19 11:33:41 -07:00
apolcyn 7af5efcfd3
Revert "[TLS - Revocation] Crl Provider (#33786)" (#34713)
This reverts commit 0f0396ae92.
2023-10-17 13:53:36 -07:00
Gregory Cooke 0f0396ae92
[TLS - Revocation] Crl Provider (#33786)
The basic APIs for the CRL Reloading features.
This adds external types to represent CRL Providers, CRLs, and
CertificateInfo.
Internally we will use `CrlImpl` - this layer is needed to hide OpenSSL
details from the user.

GRFC - https://github.com/grpc/proposal/pull/382

Things Done
* Add external API for `CrlProvider`, `Crl`, `CertInfo` (`CertInfo` is
used during CRL lookup rather than passing the entire certificate).
* Add code paths in `ssl_transport_security` to utilize CRL providers
* Add `StaticCrlProvider`
* Refactor `crl_ssl_transport_security_test.cc` so it is more extensible
and can be used with providers
2023-10-17 13:03:52 -04:00
Yijie Ma bae0c705aa
[Deps] Update to Clang-16 (#34492)
<!--

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-10-11 16:26:32 -07:00
Craig Tiller f9777ac25e
[experiments] Enforce ordering in rollouts, experiments.yaml (#34656)
Should make for easier merges going forward

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-10-11 08:13:00 -07:00
Craig Tiller 52369882d8
[promises] Add tracing to seq, join variants (#34401)
Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-09-19 11:49:12 -07:00
Craig Tiller c0155b4188
[experiments] Make codegen more merge friendly (#34393)
Remove the explicit numbering that's hostile to source code merge tools.
2023-09-18 14:54:41 -07:00
Craig Tiller a9bf741735
[fuzzing] Make it easier for fuzzers to find experiments (#34296)
The previous approach of generating strings was not converging well.
Instead, load a bitfield from the protobuf and use the bits to select
experiments. The fuzzers can explore this space swiftly.

Downside is that as experiments rotate in/out the corpus gets a bit
messed up, but I'm reasonably confident we'll recover quickly.

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-09-12 13:43:14 -07:00
h-vetinari 2d1595c9af
[Build] Shared builds on windows (#34103)
Towards https://github.com/grpc/grpc/issues/33032,

Reopen after botched force-push in #33175 that then got "merged" and
cannot be reopened anymore.

More context in that PR.

---------

Co-authored-by: Isuru Fernando <isuruf@gmail.com>
Co-authored-by: David Chamberlin <david.chamberlin@ln.email.gs.com>
2023-09-12 09:12:36 -07:00
Craig Tiller b85b57fdc7
[wrr] Add metrics to help debug high WRR cost (#34095)
WRR is showing a very high CPU cost relative to previous solutions, and
it's unclear why this is.
Add two metrics that should help us see the shape of the subchannel sets
that are being passed to high cost systems in order to confirm/deny
theories.

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-08-17 16:37:40 -07:00
Craig Tiller 8bbd11ebed
[promises] New `Join`, `TryJoin` implementation (#33995)
Our current implementation of Join, TryJoin leverage some complicated
template stuff to work, which makes them hard to maintain. I've been
thinking about ways to simplify that for some time and had something
like this in mind - using a code generator that's at least a little more
understandable to code generate most of the complexity into a file that
is checkable.

Concurrently - I have a cool optimization in mind - but it requires that
we can move promises after polling, which is a contract change. I'm
going to work through the set of primitives we have in the coming weeks
and change that contract to enable the optimization.

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-08-15 21:44:13 -07:00
Craig Tiller 54651a7168
[promises] New `Seq`, `TrySeq` implementation (#33991)
Our current implementation of `Seq`, `TrySeq` leverage some complicated
template stuff to work, which makes them hard to maintain. I've been
thinking about ways to simplify that for some time and had something
like this in mind - using a code generator that's at least a little more
understandable to code generate most of the complexity into a file that
is checkable.

Concurrently - I have a cool optimization in mind - but it requires that
we can move promises after polling, which is a contract change. I'm
going to work through the set of primitives we have in the coming weeks
and change that contract to enable the optimization.

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-08-10 09:40:13 -07:00
Vignesh Babu f85b7c79ee
[experiments] Fix processing of platform specific test tags (#33749)
Also adds a unit test: experiments_tag_test which should fail if the
appropriate tags are not set for it.
2023-07-21 16:06:01 -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
Craig Tiller 1e465cac91
[experiments] Allow deleting experiments without updating rollouts.yaml (#33628) 2023-07-06 14:22:21 -07:00
Craig Tiller 78240d42f1
[experiments] Fix some bugs for no rollout definition (#33626)
Some bugs crept in if there's no rollout defined for an experiment, fix
that up.
2023-07-06 12:11:08 -07:00
github-actions[bot] efa96780b0
Automated fix for refs/heads/master (#33610)
PanCakes to the rescue!

We noticed that our 'sanity' test was going to fail, but we think we can
fix that automatically, so we put together this PR to do just that!

If you'd like to opt-out of these PR's, add yourself to NO_AUTOFIX_USERS
in .github/workflows/pr-auto-fix.yaml

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-07-05 16:51:15 -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
github-actions[bot] 88e269dc0c
Automated fix for refs/heads/master (#33576)
PanCakes to the rescue!

We noticed that our 'sanity' test was going to fail, but we think we can
fix that automatically, so we put together this PR to do just that!

If you'd like to opt-out of these PR's, add yourself to NO_AUTOFIX_USERS
in .github/workflows/pr-auto-fix.yaml

Co-authored-by: markdroth <markdroth@users.noreply.github.com>
2023-06-30 07:31:17 +09: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
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
Craig Tiller 1f85fb21f2
[metadata] Improve codegen for name lookups (#33237)
The approach of doing a recursive function call to expand the if checks
for known metadata names was tripping up an optimization clang has to
collapse that if/then tree into an optimized tree search over the set of
known strings. By unrolling that loop (with a code generator) we start
to present a pattern that clang *can* recognize, and hopefully get some
more stable and faster code generation as a benefit.

<!--

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-06-06 14:43:55 -07:00
Craig Tiller 683261d217
[experiments] Fix debug behavior (#33358)
<!--

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-06 14:25:57 -07:00
Vignesh Babu 4adf95ca9e
[experiments] Fix experiment expiry and avoid failing BUILDS on expired experiments. (#33325) 2023-06-02 11:30:17 -07:00