Commit Graph

105 Commits

Author SHA1 Message Date
Esun Kim
a47d91c7b2 [Clean-up] Tidy fix (#37104)
Applied two clang 17 tidy fixes;

- https://clang.llvm.org/extra/clang-tidy/checks/readability/container-size-empty.html
- https://clang.llvm.org/extra/clang-tidy/checks/modernize/make-shared.html

Closes #37104

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37104 from veblush:fix-tidy 7b905869b819ac3bd6c45feed665e1f98a0585ca
PiperOrigin-RevId: 650815403
2024-07-09 18:08:10 -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
Craig Tiller
e21467475f [call-v3] Direct channel implementation (#36734)
This change brings up the direct channel, and inproc promise based transports.

This work exposed a bug that was very difficult to fix with the current call_filters.cc implementation, so I've substantially revamped that - instead of having a pipe-like object per call element, we now have a big ol' combined state machine for the entire call. It's a touch more code, but substantially easier to reason about individual cases, so I much prefer this form (it's also a slight memory improvement: 12 bytes total to track call state, and 10 of those are wakeup bitmasks...).

Closes #36734

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36734 from ctiller:transport-refs-9 3e2a80b40d77e093c3d1aabedc16015478ee4bee
PiperOrigin-RevId: 644034593
2024-06-17 09:29:46 -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
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
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
3e0eeed4fa [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS… (#36267)
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT
Replacing GPR_ASSERT with absl CHECK

Will not be replacing CHECK with CHECK_EQ , CHECK_NE etc because there are too many callsites. Only a few - which fit into single - line regex will be changed. This would be small in number just to reduce the load later.

Replacing CHECK with CHECK_EQ , CHECK_NE etc could be done using Cider-V once these changes are submitted if we want to clean up later. 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 #36267

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36267 from tanvi-jagtap:tjagtap_grpc_assert_02 3aed62610192ef9e46b2b25f215e694a4a6f6862
PiperOrigin-RevId: 623469007
2024-04-10 06:02:54 -07:00
Craig Tiller
427c8a89e9 [chaotic-good] Add a microbenchmark for ping pong round trips (#36050)
also:
- remove tail recursion from promise endpoint read completion (actually overflowed stack!)
- remove retry filter from benchmark - we probably don't want this long term, but for now nobody else is using this benchmark and our use case doesn't use grpc retries so.... good enough

Closes #36050

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36050 from ctiller:cgbm 65b1c267675035aad5f1721b57cbc4c65c0de6e1
PiperOrigin-RevId: 612577071
2024-03-04 14:07:28 -08: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
6c29a8720e [test] Remove passthru_endpiont and its microbenchmarks (#35986)
Closes #35986

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35986 from drfloob:rm-passthru-endpoint 12c491f7f6ffd474fdf6af9cdee6ca1dd012aca4
PiperOrigin-RevId: 609800868
2024-02-23 12:13:24 -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
aa11978541 Fix include guards for src/ and test/ directories (#32167)
* Fix include guards for src/ and test/ directories

* Sanity

* Update new files
2023-01-20 16:27:27 -08: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
AJ Heller
05ab5c08a4 Reland "Precondition ChannelArgs with EventEngines (#31166)" (#31469)
This reverts commit a63c81135c.

Needs a cherrypick
2022-10-26 14:52:59 -07:00
AJ Heller
a63c81135c Revert "Precondition ChannelArgs with EventEngines (#31166)" (#31462)
This reverts commit 23c7e48779.
2022-10-25 16:41:48 -07:00
AJ Heller
23c7e48779 Precondition ChannelArgs with EventEngines (#31166)
* Precondition ChannelArgs with EventEngines

If an EventEngine is not explicitly provided to ChannelArgs, the default
EventEngine will be set when ChannelArgs are preconditioned.

* channel_idle_filter: EE from channel_args

* grpclb: EE from channel_args

* weighted_target: ee from channel_args

* sanitize

* xds cluster manager

* posix native resolver: own an EE ref from iomgr initialization

* reviewer feedback

* reviewer feedback

* iwyu

* iwyu

* change ownership and remove unneeded methods

* clang_format and use consistent engine naming

* store EE ref in channel_stack and use it in channel idle filter

* don't store a separate shared_ptr in NativeDNSResolver

* add GetEventEngine() method to LB policy helper interface

* stop holding refs to the EE instance in LB policies

* clang-format

* change channel stack to get EE instance from channel args

* update XdsWrrLocalityLb

* fix lb_policy_test

* precondition channel_args in ServerBuilder and microbenchmark fixtures

* add required engine to channel_stack test

* sanitize

* dep fix

* add EE to filter fuzzer

* precondition BM_IsolatedFilter channelargs

* fix

* remove unused using statement

* iwyu again??

* remove preconditioning from C++ surface API

* fix bm_call_create

* Automated change: Fix sanity tests

* iwyu

* rm this->

* rm unused deps

* add internal EE arg macro

* precondition filter_fuzzer

* Automated change: Fix sanity tests

* iwyu

* ChannelStackBuilder requires preconditioned ChannelArgs

* iwyu

* iwyu again?

* rm build.SetChannelArgs; rm unused declaration

* fix nullptr string creation

Co-authored-by: Mark D. Roth <roth@google.com>
Co-authored-by: drfloob <drfloob@users.noreply.github.com>
2022-10-25 14:49:59 -07:00
Craig Tiller
20d1efc38a [stats] Move core stats to C++ (#30936)
* begin c++

* Automated change: Fix sanity tests

* progress

* progress

* missing-files

* Automated change: Fix sanity tests

* moved-from-stats

* remove old benchmark cruft, get tests compiling

* iwyu

* Automated change: Fix sanity tests

* fix

* fix

* fixes

* fixes

* add needed constructor

* Automated change: Fix sanity tests

* iwyu

* fix

* fix?

* fix

* fix

* Remove ResetDefaultEventEngine

Now that it is a weak_ptr, there's no need to explicitly reset it. When
the tracked shared_ptr is deleted, the weak_ptr will fail to lock, and a
new default EventEngine will be created.

* forget existing engine with FactoryReset

* add visibility

* fix

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
Co-authored-by: AJ Heller <hork@google.com>
2022-10-09 21:22:08 -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
Yash Tibrewal
674e938de5 More tests prep for graceful goaway (#29076)
* More tests prep for graceful goaway

* clang-tidy
2022-03-10 16:55:09 -08: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
Craig Tiller
0ea2c37263 Revert "New resource quota integration (#27643)" (#28014)
This reverts commit 39f0877d25.
2021-11-11 14:26:19 -08:00
Craig Tiller
39f0877d25 New resource quota integration (#27643)
* new resource quota integration

* Automated change: Fix sanity tests

* fix

* fix

* fixes

* fixes

* fixes

* Automated change: Fix sanity tests

* fixes

* fixes

* Automated change: Fix sanity tests

* fixes

* fix

* fixes

* windows-fix

* fixes

* fixes

* fix

* fix-asan

* banned

* banned

* fixes

* clang-tidy-fix

* Automated change: Fix sanity tests

* fix-cronet

* review feedback

* review feedback

* Automated change: Fix sanity tests

* fixes

* bug fix

* fixes

* compile fix

* exclude megabyte size payloads from 1byte tests

* windows fix

* start moving ios

* keep moving windows

* Get windows compilation working.

* Automated change: Fix sanity tests

* better

* fixes

* remove slice buffer from memory_allocator.h

* Revert "remove slice buffer from memory_allocator.h"

This reverts commit 234a63b6e3c5a7f35feb8137338cf5b555bc4d80.

* ugh

* #fixtests

* pthread tls fixes

* Automated change: Fix sanity tests

* fixfixfix

* xxx

* add reset

* review feedback

* fix

* fix

* fixes

* fix

* mac progress

* cpp-impl-of

* rename ptr

* Automated change: Fix sanity tests

* memory-owner-is-a-memory-allocator

* fixes

* fix

* fix from prod

* fix

* Fix issue leading to bad pointers being returned on Windows.

* Automated change: Fix sanity tests

* fix multislice bug

* argh

* hyrums law fixes

* hyrums law fixes

* clang-format

* hyrums law fixes

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-11-10 22:53:04 -08:00
Esun Kim
e246811e55 Add (void) to function calls returning absl::Status (#27761) 2021-10-19 17:00:40 -07:00
Craig Tiller
ea389c00c2 Adjust include order per style guide (#27175)
Introduce clang-format configuration to sort includes closer to our rules.
2021-09-08 12:14:44 -07:00
AJ Heller
d10617edb5 Move resource_user ownership into chttp2 transport/server/connector v2 (#27032)
Reintroducing PR #26643, which was reverted in #27029

Fixed a memory leak and added a test that would have caught it (ASAN build): ca0c8c4
2021-08-18 17:04:00 -07:00
Craig Tiller
f5d3ed2db1 Revert "Move resource_user ownership into chttp2 transport/server/connector (#26643)" (#27029)
This reverts commit d1935a65a1. Will be rolled forward with a fix.
2021-08-16 19:07:39 -07:00
AJ Heller
d1935a65a1 Move resource_user ownership into chttp2 transport/server/connector (#26643) 2021-08-16 13:50:56 -07:00
Yash Tibrewal
7021b72d1f Revert Revert Xds Status Notifier (#25718)
* Revert "Revert "xDS status notifier (#25321)" (#25702)"

This reverts commit 3c9f3972e3.

* Remove connection from map when OnClose is not registered

* Reviewer comments
2021-03-15 14:29:06 -07:00
Yash Tibrewal
3c9f3972e3 Revert "xDS status notifier (#25321)" (#25702)
This reverts commit 81e90432e1.
2021-03-12 08:54:34 -08:00
Yash Tibrewal
81e90432e1 xDS status notifier (#25321)
* Serving status notification for xds enabled servers
2021-03-08 21:47:13 -08:00
Esun Kim
53ab235fb8 Fix google-explicit-constructor 2020-12-03 15:03:39 -08:00
Esun Kim
e7434d385e Fix by tidy-modernize-use-override 2020-10-16 14:01:06 -07:00
Mark D. Roth
0b61aea1c5 Convert grpc_server to idiomatic C++. 2020-08-03 12:56:29 -07:00
Vijay Pai
9d79ca6058 C++ify core server 2020-07-20 03:15:18 -07:00
Esun Kim
165ee5007a Replaced grpc::string with std::string 2020-06-29 17:56:36 -07:00
Vijay Pai
2678afe310 Stop using core server shutdown in microbenchmarks 2020-01-21 14:24:42 -08:00
Vijay Pai
6ca827a008 Remove unused parameter warning (18 of 20) 2019-10-17 08:52:05 -07:00
Karthik Ravi Shankar
40210d3b8a Move Channel to grpc_impl 2019-05-17 09:12:33 -07:00