Commit Graph

441 Commits

Author SHA1 Message Date
GitHub Actions
a366cd0791 Update artifacts branch 2025-10-28 22:15:26 +00:00
GitHub Actions
af19da8ec8 Update artifacts branch 2025-06-27 19:38:42 +00:00
Craig Tiller
a0f45af368 [experiments] Optimize IsExperimentEnabled (#37057)
Brings measured CPU for this function from 1.95ns down to 0.4ns.

Closes #37057

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37057 from ctiller:xp 99a423016ec69a04cd532cbeac0a92c7aad7ee0e
PiperOrigin-RevId: 647389088
2024-06-27 11:34:47 -07:00
Craig Tiller
f33083bfd5 [promises] Add always inline to basic combinators (#36981)
These are substitutes for language features and never warrant a new function being created. Significantly boosts the benchmarks in #36946

Closes #36981

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36981 from ctiller:seqqy 1a075be7e9dd0a978f730083928e335409a0a057
PiperOrigin-RevId: 645169296
2024-06-20 15:10:31 -07:00
Yash Tibrewal
2e4e92bb87 [log] Do not set absl min log level if user does not set GRPC_VERBOSITY (#36931)
Do not set `absl::MinLogLevel` if user does not set `GRPC_VERBOSITY`. Only set `absl::MinLogLevel` if the user has specified `GRPC_VERBOSITY`.

Background:
gRPC Core overrides the setting of `absl::MinLogLevel` based on the setting of `GRPC_VERBOSITY`.
`GRPC_VERBOSITY` defaults to the setting of `GPR_DEFAULT_LOG_VERBOSITY_STRING` if that env var is not set, resulting in the consequence that gRPC Core would override the setting of `absl::MinLogLevel` even if the user had previously modified it.

Note that even with this change, the minimum log severity that's printed remains at `ERROR` by default.

Closes #36931

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36931 from yashykt:ChangeDefaultGrpcVerbosity ee92404c35bad2886396681ca2f0f729fed4a4b7
PiperOrigin-RevId: 644127489
2024-06-17 14:11:21 -07:00
AJ Heller
c9fdef1317 [logging] Centralize configuration for trace flags (#36576)
All TraceFlags are now configured in `src/core/lib/debug/trace_flags.yaml`. The format is:

```
my_flag:
  default: false                   # the default value; default=false
  description: Some Description
  debug_only: false                # debug_only flags only work in debug builds; default=false
  internal: false                  # internal flags will not show up in documentation; default=false
```

To regenerate the trace flag source code, run `tools/codegen/core/gen_trace_flags.py` (requires mako). This script is also run when sanity checking.

This PR also adds two new features:

### Glob-based flag configuration

Trace flag configuration now supports `?` (single wildcard character) and `*` (one or more wildcard characters).  For example, using `GRPC_TRACE='event_engine*'` will enable all flags that match that glob. It expands to:

* event_engine
* event_engine_client_channel_resolver
* event_engine_dns
* event_engine_endpoint
* event_engine_endpoint_data
* event_engine_poller

### A cleaner trace-logging macro in abseil logging format

If your goal is only to add log statements when the `fault_injection_filter` trace flag is enabled, you can use the macro:

```
GRPC_TRACE_LOG(fault_injection, INFO) << "Filtered:" << 42;
```

When the trace flag is enabled, the the log will show something like this:
```
I0000 00:00:1715733657.430042      16 file.cc:174] Filtered:42
```

----

Note: just like with the gpr_log to abseil logging conversion, the pre-existing trace logging usages can be replaced with the new tracing macro across multiple PRs.

Closes #36576

PiperOrigin-RevId: 641295215
2024-06-07 10:47:38 -07:00
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 54ee362e3d306c9b3685dfe02220d1f89bede098
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 5dcc85e006581a8fc52a3a914baa5f33e4a21589
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 c160ab231acec7e78c7efeadaf57e2c233e18a1e
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 a44a2992736c2c45c044452ec892e6ac4d173b7b
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 0c1f82ed71e54eb3f3445607301feef531ff391c
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 ac22512f9961c0e9d815ec09eb68a243c9ac36c4
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 f67e542a8b557617838e19ace37250ecff25172b
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 fea10949d35881a33511fbe7a2f0311edde106f5
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 5308a914c689b79e5e83f218ae0cd7e88bc0034e
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 a39f71f37fc188f26dafc8fa8d09251e08abbc07
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 bc0d47395fb6c8ea373b416a29878bda9b1b8a91
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 30f5f809c6514d38bf1ee3fe9180d52ae03a6833
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 8e4f033317d67c88ddca520510be01f56f72a141
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