113 Commits

Author SHA1 Message Date
Rishesh Agarwal
09218ae889 Adding layering_check and parse_headers in test files (#41226)
Closes #41226

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/41226 from rishesh007:layering_test 02e735767f22e934850d5e150c5e3d577bdfbecb
PiperOrigin-RevId: 844606259
2025-12-14 23:05:28 -08:00
Craig Tiller
339906443b [clang-format] Match include file ordering to internal clang-format (#40905)
gRPC is currently getting formatted with two different clang-format implementations, and due to some weirdness they have different include file orderings. This change introduces clang-format configuration to ensure that the two systems align - it's *highly* expected that this will need some maintenance going forward as the two systems evolve.

Closes #40905

PiperOrigin-RevId: 819606209
2025-10-15 00:24:11 -07:00
Rishesh Agarwal
ecb1d4a9b7 This PR adds the missing dependencies src/core:grpc_check and :channel_arg_names to the relevant parts of the codebase
PiperOrigin-RevId: 814622149
2025-10-03 03:29:30 -07:00
Adam Heller
f5ffef4d6b [test] Add PostMortem dumps on CHECK failures in test builds (#39945)
See `grpc_check.h`. This code  redefines the abseil `CHECK*` macros using custom gRPC macros when building tests. In `bazel test ...` builds, on check failure, `PostMortemEmit()` will dump state to the log before crashing.

Caveat: to prevent circular dependencies, code that `postmortem` relies on cannot use the custom gRPC CHECK macros. This is not much code, ~50 source files. grep for the `absl/log:check` bazel dependency.

Closes #39945

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/39945 from drfloob:grpc_check ca8e46718f2021e0df79aa67a3a0b0c751b3ce44
PiperOrigin-RevId: 807452496
2025-09-15 17:43:19 -07:00
Rishesh Agarwal
8eff73be73 [build] Add Missing Dependencies for test/cpp/test, test/cpp/security, test/cpp/grpclb, test/cpp/performance in Preparation for Enabling layering_check
PiperOrigin-RevId: 797264957
2025-08-20 05:07:48 -07:00
Craig Tiller
a0e74485a9 Integrate memory quota with channelz
This exposes a bunch of useful debug information about memory quotas into channelz.

PiperOrigin-RevId: 788423608
2025-07-29 06:08:00 -07:00
Vignesh Babu
53bc6c6440 [telemetry] Re-land https://github.com/grpc/grpc/pull/39530
PiperOrigin-RevId: 767711712
2025-06-05 12:17:24 -07:00
Vignesh Babu
788e5340b3 Automated rollback of commit 4a186266fd.
PiperOrigin-RevId: 758903258
2025-05-14 17:50:34 -07:00
Vignesh Babu
4a186266fd [telemetry] Change the schema of the stats_data definitions to better handle scoped metrics
PiperOrigin-RevId: 758840524
2025-05-14 14:44:08 -07:00
Craig Tiller
915b34cef5 [channelz] Add tracers to chaotic-good (#39233)
At the same time, makes the change to elevate channelz to a first class thing a transport should provide.
We still (for the moment) allow a transport to return a null SocketNode, but the transport must explicitly opt to do so.
In turn, update subchannel, server code to use the transport API to retrieve this object, instead of using an alternative squirrly method that's different between client, server.

Closes #39233

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/39233 from ctiller:cg-tracer 7141b9bd8ccb802b21e1ba428f80c0fde05083f4
PiperOrigin-RevId: 749971664
2025-04-21 17:25:05 -07:00
Craig Tiller
66a137f1d7 [sanity] Restore it (#38869)
Closes #38869

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38869 from ctiller:nubbins 972d734cdf45a4786de53c51b2ce8cf97a3d38ff
PiperOrigin-RevId: 731570368
2025-02-26 21:26:56 -08:00
Craig Tiller
07188632f4 Tiny formatting cleanups for portability
PiperOrigin-RevId: 731512282
2025-02-26 17:22:27 -08:00
AJ Heller
11bfbb8420 [EventEngine] Add SetDefaultEventEngine API (and friends) (#38316)
Closes #38316

PiperOrigin-RevId: 716392744
2025-01-16 15:07:02 -08:00
Mark D. Roth
7570d8b545 [reorg] move src/core/lib/config -> src/core/config (#37847)
Closes #37847

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37847 from markdroth:reorg_config 191c5460bc2b9c974bf76a3eedc876963d296f47
PiperOrigin-RevId: 698957093
2024-11-22 05:46:04 +00:00
Mark D. Roth
55b1ae9700 [build] replace grpc_proto_library rules with separate proto_library/cc_proto_library/cc_grpc_library rules (#37943)
Closes #37943

PiperOrigin-RevId: 691538475
2024-10-30 13:45:41 -07:00
Craig Tiller
dbb5164ac7 [clang-format] Remove custom clang-format rules for include ordering (#37820)
Closes #37820

PiperOrigin-RevId: 682352913
2024-10-04 09:44:20 -07:00
Mark D. Roth
f6c57b6384 [reorg] move a bunch of stuff to src/core/util (#36792)
The following files have been moved:
- src/core/lib/avl/*
- src/core/lib/backoff/*
- src/core/lib/debug/event_log*
- src/core/lib/iomgr/gethostname*
- src/core/lib/iomgr/grpc_if_nametoindex*
- src/core/lib/matchers/*
- src/core/lib/uri/* (renamed from uri_parser.* to uri.*)
- src/core/lib/gprpp/* (existing src/core/util/time.cc was renamed to gpr_time.cc to avoid conflict)

Closes #36792

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36792 from markdroth:reorg_util d4e8996f481c611ffbb06a8b04924ff81bc1bc2b
PiperOrigin-RevId: 676947640
2024-09-20 13:19:02 -07:00
Mark D. Roth
fa84360551 Automated rollback of commit af492ae70a.
PiperOrigin-RevId: 646224695
2024-06-24 14:39:23 -07:00
Mark D. Roth
af492ae70a Automated rollback of commit f1ab1d8cf3.
PiperOrigin-RevId: 645167659
2024-06-20 15:05:51 -07:00
Mark D. Roth
f1ab1d8cf3 [handshaker API] update handshaker API to use modern types
Specifically:
- use `OrphanablePtr<>` for `grpc_endpoint`
- use `absl::AnyInvocable<>` instead of `grpc_closure`
- use `EventEngine::Run()` instead of `ExecCtx::Run()`
- use `SliceBuffer` instead of `grpc_slice_buffer`
- use `absl::Status` instead of `grpc_error_handle`
- use `absl::string_view` instead of `const char*` for handshaker names

Also pass acceptor via `HandshakerArgs` instead of as a separate parameter.

Also changed chttp2 and httpcli to use `OrphanablePtr<>` for the endpoint.

PiperOrigin-RevId: 644551906
2024-06-18 16:49:51 -07:00
Mark D. Roth
9b1bb788aa [endpoint] Remove grpc_endpoint_shutdown().
This gives grpc_endpoint the same destruction-is-shutdown semantic as
EventEngine::Endpoint, which will make the migration easier.
PiperOrigin-RevId: 639867616
2024-06-03 12:10:56 -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
154081a92a [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - gpr_log (#36678)
[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 #36678

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36678 from tanvi-jagtap:test_cpp_gpr_log 81b8f4179f6111b902cbed9eb65ef6f41eb1e32d
PiperOrigin-RevId: 636410944
2024-05-22 21:59:06 -07:00
AJ Heller
bc5570bec8 Revert "[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - BUILD (#36607)" (#36625)
This reverts commit 15850972dd.

Breaks the bazel distribtests. https://source.cloud.google.com/results/invocations/da317d7c-5240-445f-8953-68a840ccc892/targets/%2F%2Ftools%2Fbazelify_tests%2Ftest:bazel_distribtest_6.5.0_buildtest/log

Closes #36625

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36625 from drfloob:revert-36607 395191f9c700e9b5206cef3bb44d875924602898
PiperOrigin-RevId: 633995522
2024-05-15 10:18:57 -07:00
AJ Heller
6edaa28cc7 [test] Nerf WritesPerRpcTest due to timeout (#36612)
With 1k iterations instead of 10k iterations, this test takes ~90s in the RBE environment. There must have been a regression somewhere, since this test did not used to fail every time.

Closes #36612

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36612 from drfloob:nerf-writes-per-rpc 0ba8af41675c5560aa11cd18b57076ed279934db
PiperOrigin-RevId: 633677652
2024-05-14 12:57:35 -07:00
Tanvi Jagtap
15850972dd [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - BUILD (#36607)
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - BUILD
In this CL we are just editing the build and bzl files to add dependencies.
This is done to prevent merge conflict and constantly having to re-make the make files using generate_projects.sh for each set of changes.

Closes #36607

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36607 from tanvi-jagtap:build_test_cpp 3e17d778d03272cd51da86baa38b67f77760735c
PiperOrigin-RevId: 633523097
2024-05-14 03:37:04 -07:00
Mark D. Roth
1e5fc3df8b [reorg] move server code to src/core/server (#36475)
Closes #36475

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36475 from markdroth:reorg_server 30edc04c0ff20159a0d2726b4c791bba4cdd5fc0
PiperOrigin-RevId: 629776917
2024-05-01 11:16:02 -07:00
Tanvi Jagtap
aa46d266c5 [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT
Replacing GPR_ASSERT with absl CHECK in the previous test.

Some instances of CHECK_OK are causing tests to fail.

Fixing.

PiperOrigin-RevId: 629387759
2024-04-30 06:06:37 -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
30386413c0 [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT (#36438)
[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 #36438

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36438 from tanvi-jagtap:tjagtap_cpp 405efd63c33aaef551368578c06d01eb85e2a629
PiperOrigin-RevId: 628281347
2024-04-25 21:03:38 -07:00
Mark D. Roth
0213523907 [build] move channel out of grpc_base (#35924)
This adds the following new targets:
- `channel`: A virtual interface for a channel.
- `legacy_channel`: A channel implementation that supports the filter stack and call v2.
- `channel_create`: A standalone function to create a channel.
- `server_interface`: A base class with a few accessor methods used in surface/call.cc.
- `server`: The actual server implementation.
- `api_trace`, `call_tracer`, `server_call_tracer_filter`, `call_finalization`: These were split out of `grpc_base` to avoid various dependency problems.
- `compression`: This is a combination of the previously existing `compression_internal` target and the compression code that was part of `grpc_base`.

Closes #35924

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35924 from markdroth:channel_interface 94a7fffddb644375cd49ae2c7aec142548db0d2b
PiperOrigin-RevId: 612512438
2024-03-04 11:07:17 -08:00
AJ Heller
b6a961fa8e [EventEngine] Refactor WritesPerRpcTest to EventEngine (#35763)
Closes #35763

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35763 from drfloob:eeify-writes-per-rpc ebb79f7dd62eeaa6ab50da74d3d608b6591b9335
PiperOrigin-RevId: 608719485
2024-02-20 13:41:21 -08:00
Craig Tiller
a0c1027bb3 [transport] Move transport interface to C++ (#34618)
Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-10-18 13:13:23 -07: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
Craig Tiller
67f364e23e [cleanup] Eliminate usage of GRPC_ASSERT(false...); (#31757)
* crash function

* progress

* fix

* fix

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fixes

* Automated change: Fix sanity tests

* fix

* Automated change: Fix sanity tests

* fix

* fix

* use cpp attr

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fix

* fix

* fix

* add exclusion

* fix

* typo

* fix

* fmt

* Update tcp_socket_utils.cc

* Automated change: Fix sanity tests

* fix

* revert php changes

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-01-11 08:50:32 -08:00
Yijie Ma
f99b8b5bc4 Convert c-style comments to C++-style comments (#31923)
* baseline

* fix clang-tidy

* manually revert these files

* manually fixup at eof

* revert 2 more files

* change check_deprecated_grpc++.py

* change end2end_defs.include template

* fix check_include_guards.py

* untrack tools/distrib/python/convert_cstyle_comments_to_cpp.py

not yet ready to be submitted

* fix

yapf check_include_guards.py
remove a space...

* fix version.cc.template

* fix version_info.h.template
2022-12-22 23:01:53 -08:00
Cheng-Yu Chung
77b3972f95 Clean up the TODO item in build target grpc_base part channel_args (#31642)
* Clean up the TODO item in build target `grpc_base` part `channel_args`

* Update

* Update

* Update

* Automated change: Fix sanity tests

* update

* Automated change: Fix sanity tests
2022-11-23 16:01:34 -05:00
Craig Tiller
05e6bf2e4a [build] Add test/core/util, test/core/event_engine to auto build deps (#30364)
* [build] Add test/core/util, test/core/event_engine to auto build deps

* deal with suppressions

* fix suppressions

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fix

* progress

* Automated change: Fix sanity tests

* fix

* fix

* fix

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-07-25 21:59:25 -07:00
Craig Tiller
d7e6878ec4 [chttp2] use new channel args type (#30252)
* x

* x

* Automated change: Fix sanity tests

* fix

* fix

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-07-10 22:43:44 -07:00
Craig Tiller
d304712f64 [channel_args] Spread grpc_core::ChannelArgs through client channel code (#30008)
* [channel_args] Spread grpc_core::ChannelArgs through client channel code

* progress

* progress

* grpc compiles

* uniqueptr+compiles

* fix

* fix

* fix

* fix

* fix

* fix

* fixes

* fix

* fix

* fixes

* fix-lb

* fix

* fix up arg construction

* fix

* fix

* fix

* fix

* move to const& to save bytes

* fix

* fix

* progress

* review feedback

* fix

* fix

* fixes

* fixes

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* fix

* fix

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* fix

* debug-helper

* Automated change: Fix sanity tests

* fix

* Automated change: Fix sanity tests

* fix

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-07-07 19:19:11 -07:00
Craig Tiller
8bb45aa3a6 Convert grpc_channel to C++ (#29266)
* begin

* tests

* fix

* http

* Filter fuzzer

* progress

* basics

* progress

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* Revert "Revert "HTTP Client Filter --> promises (#29031)" (#29181)"

This reverts commit 6ee276f672.

* stuff

* debug

* minimal reproduction

* progress

* progress

* create call

* progress

* recv trailing metadata

* wakeups

* corpus

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* debug

* fix state machine for c#

* Revert "minimal reproduction"

This reverts commit 4d02d2e7301172410d7243de70e993f5275c732b.

* Revert "debug"

This reverts commit 7960842f48742575eb0c60aa5e983ee13793bbb5.

* Revert "debug"

This reverts commit a6f224e4a1fe8376d7dfc019c8c37074a4fd3de4.

* no-logging

* initial-metadata

* Revert "Revert "debug""

This reverts commit 951844e8573caacf1061ac8f5e9c2ce73e747d2b.

* Better int conversion

* debug

* Fix for Cronet

* Revert "debug"

This reverts commit 4d641c428142d60aa6133b71a5b78643ec9c929a.

* Revert "Better int conversion"

This reverts commit 4001b957cb775ca148b3f6f28a3faed3f087f9be.

* Revert "Revert "Revert "debug"""

This reverts commit d135c610432227393eedb954bab058f151ab0bc6.

* progress

* progress

* Automated change: Fix sanity tests

* fix, c++ize

* handle transport, use objects

* enable more stuffs

* remove placeholder

* contexts

* fix

* fix

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* x

* exceptional toast

* include idle filters, time

* fix

* namespace

* fixes

* final info

* progress

* cleanup

* progress

* progress

* progress

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* progress

* Set int

* Set int

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fixes

* fixes

* fixes

* fixes

* fix

* fix race

* fix race

* mac fix

* review feedback

* getgetget

* fix ios

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
Co-authored-by: Jan Tattermusch <jtattermusch@google.com>
2022-04-20 20:55:15 -07:00
AJ Heller
18a8f6aad9 Refactor end2end tests to exercise each EventEngine (#29202)
* Refactor end2end tests to exercise each EventEngine

* fix incorrect bazel_only exclusions

* Automated change: Fix sanity tests

* microbenchmark fix

* sanitize, fix iOS flub

* Automated change: Fix sanity tests

* iOS fix

* reviewer feedback

* first pass at excluding EventEngine test expansion

Also caught a few cases where we should not test pollers, but should
test all engines. And two cases where we likely shouldn't be testing
either product.

* end2end fuzzers to be fuzzed differently via EventEngine.

* sanitize

* reviewer feedback

* remove misleading comment

* reviewer feedback: comments

* EE test_init needs to play with our build system

* fix golden file test runner

Co-authored-by: drfloob <drfloob@users.noreply.github.com>
2022-03-30 15:43:05 -07:00
AJ Heller
85189b24bb Reintroduce: Avoid fully qualifying namespaces (and add check) (#28917)
Based on a handful of https://abseil.io/tips, it's generally advised to
only fully-qualify namespaces when in a `using` statement, or when it's
otherwise required for compilation. In all other cases, the general
recommendation is to not fully-qualify.

This change fixes most `grpc.*` namespace uses. There are potential
challenges in trying to make blanket changes to non-gRPC namespace uses,
such as `::testing`, since there is also a `grpc::testing` namespace.
2022-02-18 16:18:54 -08:00
AJ Heller
e72a5fe5dd Revert "Avoid fully qualifying namespaces (and add check) (#28901)" (#28916)
This reverts commit fc7314c701.
2022-02-17 17:56:19 -08:00
AJ Heller
fc7314c701 Avoid fully qualifying namespaces (and add check) (#28901)
Based on a handful of https://abseil.io/tips, it's generally advised to
only fully-qualify namespaces when in a `using` statement, or when it's
otherwise required for compilation. In all other cases, the general
recommendation is to not fully-qualify.

This change fixes most `grpc.*` namespace uses. There are potential
challenges in trying to make blanket changes to non-gRPC namespace uses,
such as `::testing`, since there is also a `grpc::testing` namespace.
2022-02-17 16:23:25 -08:00
yihuaz
b458db9246 Eliminate gRPC insecure build (#25586)
* force submit

* fix test error

* remove is_client from local tsi and its callsites

* fix too_many_pings_test

* add missing dep
2022-02-10 11:17:18 -08:00
Mark D. Roth
0bdb4d650b Revert "Revert "use CppImplOf for grpc_server (#28112)" (#28130)" (#28144)
This reverts commit eec0ca98c1.
2021-11-19 09:15:04 -08:00
Mark D. Roth
eec0ca98c1 Revert "use CppImplOf for grpc_server (#28112)" (#28130)
This reverts commit 2ea8e50c3a.
2021-11-18 14:50:39 -08:00
Mark D. Roth
2ea8e50c3a use CppImplOf for grpc_server (#28112)
* use CppImplOf for grpc_server

* fix build

* fix sanity
2021-11-17 07:46:53 -08:00
Craig Tiller
a629c9a03e Reland resource quota work (#28017)
* Check if memory owner available prior to polling it

The transport may drop the memory owner during its destruction sequence

* tcp_fix

* Revert "Revert "New resource quota integration (#27643)" (#28014)"

This reverts commit 0ea2c37263.

* clang-format

* fix-path

* fix
2021-11-15 08:23:51 -08:00