Commit Graph

660 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
fe817c8ab1 [reorg] move lib/json -> util/json (#36645)
Closes #36645

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36645 from markdroth:reorg_json 5b6434dd44a0d147731db08b7c2154f61d3b0ef9
PiperOrigin-RevId: 636757495
2024-05-23 19:51:49 -07:00
Mark D. Roth
58a4b9c922 [reorg] move src/core/lib/gpr -> src/core/util (#36543)
Closes #36543

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36543 from markdroth:reorg_util_gpr ba84e186beb1ec50d09bcf91ebd16e88b8e225aa
PiperOrigin-RevId: 634113744
2024-05-15 16:32:20 -07:00
Mark D. Roth
178c63aae7 [channelz] modernize channel trace test (#36582)
This cleans up the channel trace test to provide better output when tests fail, which will help diagnose the problem with b/339066599.

Closes #36582

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36582 from markdroth:channelz_test_fix fd287182adcf0a65c3130980b492d5add0fbe88a
PiperOrigin-RevId: 633358151
2024-05-13 15:58:17 -07:00
Tanvi Jagtap
9cbde967bb [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - gpr_log (#36517)
[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)

Closes #36517

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36517 from tanvi-jagtap:gpr_log_init 4c886dafff7e8fecffd623d13cc0548c6fcce787
PiperOrigin-RevId: 630551354
2024-05-03 18:37:34 -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
b0de95507c [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT (#36441)
[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 #36441

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36441 from tanvi-jagtap:tjagtap_util_01 ca1029292553077d25559938604e1e08fc4bbe2b
PiperOrigin-RevId: 627961969
2024-04-24 22:46:32 -07:00
Alisha Nanda
f7962578c1 [gRPC CLI] Add a --channel_args string flag (a=b,c=d).
PiperOrigin-RevId: 625783208
2024-04-17 13:14:34 -07:00
Craig Tiller
b0cf42d86e [clang-format] Remove requirement that port_platform.h is at the top (#36281)
Closes #36281

PiperOrigin-RevId: 623176865
2024-04-09 08:58:34 -07:00
AJ Heller
f238e5399c [security] Reland: Refactor credentials types to remove special handling for insecure creds (#36242)
See #36176. The only difference is a temporary shim for Secure credentials types, which was already discussed and approved separately.

Closes #36242

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36242 from drfloob:reland/36176 f07bebe289b334b0dbf090bc67264e77c0821e9d
PiperOrigin-RevId: 621879911
2024-04-04 09:20:02 -07:00
AJ Heller
da43a61322 Automated rollback of commit 822311c0d9.
PiperOrigin-RevId: 621025232
2024-04-01 19:51:52 -07:00
AJ Heller
822311c0d9 [security] Refactor credentials types to remove special handling for insecure creds (#36176)
Forked from #35957

This PR refactors the credentials types to remove Secure and Insecure Channel and Call credentials types. We standardize on a `c_creds()` accessor method for all credentials types, which can now be treated uniformly. This notably removes special-case handling of insecure credentials.

The special code-paths for insecure creds are no longer necessary in the wake of #25586.

Closes #36176

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36176 from drfloob:fork/35957/creds-API fd64d59c23a78bd9cfd889d9aff3fbd135fc78b3
PiperOrigin-RevId: 621008166
2024-04-01 18:12:59 -07:00
Esun Kim
98a96c5068 [Protobuf] Absorb protobuf::MultiFileErrorCollector change 2 (#35898)
Additional touch on top of https://github.com/grpc/grpc/pull/35870

Closes #35898

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35898 from veblush:protobuf-sv 3b8410b6f6e574c9069196acd558184230e9196e
PiperOrigin-RevId: 606699149
2024-02-13 11:56:17 -08:00
Mark D. Roth
41606054c2 [load_file] remove grpc_load_file() in favor of grpc_core::LoadFile() (#35857)
Closes #35857

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35857 from markdroth:highlander 7b7d95aaa99a1156208d8c51c1f4f746f0278edf
PiperOrigin-RevId: 605742734
2024-02-09 15:16:24 -08:00
Esun Kim
bc04417440 [Clean-up] Fix Abseil-usage (#35590)
Some minor fixes for https://github.com/grpc/grpc/pull/35589

Closes #35590

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35590 from veblush:abseil-fix a89b800739938e482661357bb6e5c9df54d84e47
PiperOrigin-RevId: 599524969
2024-01-18 09:09: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
Eugene Ostroukhov
3ed72c0c60 [reflection] Add v1 reflection (#34599) 2023-10-06 11:40:31 -07:00
Craig Tiller
3b0916fc0a Revert "[reflection] Add v1 reflection" (#34594)
Reverts grpc/grpc#34535
2023-10-04 19:06:58 -07:00
Eugene Ostroukhov
5817f0f6c1 [reflection] Add v1 reflection (#34535) 2023-10-04 11:09:59 -07:00
Yijie Ma
28291781ba [Windows] Make resolver_component_tests_runner_invoker run with Bazel on RBE (#34122)
This makes the resolver component tests suite run on Window RBE by
adding a flag in the test driver to further differentiate between Bazel
local run and Bazel RBE run on Windows since they have different
RUNFILES behavior.

Local Bazel run succeeds:
```
C:\Users\yijiem\projects\grpc>bazel --output_base=C:\bazel2 test --dynamic_mode=off --verbose_failures --test_arg=--running_locally=true //test/cpp/naming:resolver_component_tests_runner_invoker
INFO: Analyzed target //test/cpp/naming:resolver_component_tests_runner_invoker (0 packages loaded, 0 targets configured).
INFO: Found 1 test target...
Target //test/cpp/naming:resolver_component_tests_runner_invoker up-to-date:
  bazel-bin/test/cpp/naming/resolver_component_tests_runner_invoker.exe
INFO: Elapsed time: 196.080s, Critical Path: 193.21s
INFO: 2 processes: 1 internal, 1 local.
INFO: Build completed successfully, 2 total actions
//test/cpp/naming:resolver_component_tests_runner_invoker                PASSED in 193.1s

Executed 1 out of 1 test: 1 test passes.
```

RBE run succeeds:
```
C:\Users\yijiem\projects\grpc>bazel --bazelrc=tools/remote_build/windows.bazelrc test --config=windows_opt --dynamic_mode=off --verbose_failures --host_linkopt=/NODEFAULTLIB:libcmt.lib --host_linkopt=/DEFAULTLIB:msvcrt.lib --nocache_test_results //test/cpp/naming:resolver_component_tests_runner_invoker
INFO: Invocation ID: d467f2e3-7da6-4bb5-8b9b-84f1181ebc60
WARNING: --remote_upload_local_results is set, but the remote cache does not support uploading action results or the current account is not authorized to write local results to the remote cache.
INFO: Streaming build results to: https://source.cloud.google.com/results/invocations/d467f2e3-7da6-4bb5-8b9b-84f1181ebc60
INFO: Analyzed target //test/cpp/naming:resolver_component_tests_runner_invoker (0 packages loaded, 133 targets configured).
INFO: Found 1 test target...
Target //test/cpp/naming:resolver_component_tests_runner_invoker up-to-date:
  bazel-bin/test/cpp/naming/resolver_component_tests_runner_invoker.exe
INFO: Elapsed time: 41.627s, Critical Path: 39.42s
INFO: 2 processes: 1 internal, 1 remote.
//test/cpp/naming:resolver_component_tests_runner_invoker                PASSED in 33.0s

Executed 1 out of 1 test: 1 test passes.
INFO: Streaming build results to: https://source.cloud.google.com/results/invocations/d467f2e3-7da6-4bb5-8b9b-84f1181ebc60
INFO: Build completed successfully, 2 total actions
```


<!--

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-08-24 11:05:50 -07:00
Eugene Ostroukhov
440eef2288 [Import] Revert #34027 and #34129 (#34133)
This reverts commit 16b67ae312.
2023-08-22 15:55:59 -07:00
Eugene Ostroukhov
cd873f355b Revert "[Windows] Make resolver_component_tests_runner_invoker run wi… (#34129)
…th Bazel on Windows (#34107)"

This reverts commit d540b4c088.
2023-08-22 13:44:15 -07:00
Yijie Ma
d540b4c088 [Windows] Make resolver_component_tests_runner_invoker run with Bazel on Windows (#34107)
Local Bazel invocation succeeds:

```
C:\Users\yijiem\projects\grpc>bazel --output_base=C:\bazel2 test --dynamic_mode=off --verbose_failures //test/cpp/naming:resolver_component_tests_runner_invoker@poller=epoll1
INFO: Analyzed target //test/cpp/naming:resolver_component_tests_runner_invoker@poller=epoll1 (0 packages loaded, 0 targets configured).
INFO: Found 1 test target...
Target //test/cpp/naming:resolver_component_tests_runner_invoker@poller=epoll1 up-to-date:
  bazel-bin/test/cpp/naming/resolver_component_tests_runner_invoker@poller=epoll1.exe
INFO: Elapsed time: 199.262s, Critical Path: 193.48s
INFO: 2 processes: 1 internal, 1 local.
INFO: Build completed successfully, 2 total actions
//test/cpp/naming:resolver_component_tests_runner_invoker@poller=epoll1  PASSED in 193.4s

Executed 1 out of 1 test: 1 test passes.
```

The local invocation of RBE failed with linker error `LINK : error
LNK2001: unresolved external symbol mainCRTStartup`, but that does not
limited to this target:
https://gist.github.com/yijiem/2c6cbd9a31209a6de8fd711afbf2b479.

<!--

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-08-21 16:20:55 -07:00
Mario Jones Vimal
1c0f5d32a0 [core/gpr] Move subprocess to gpr and add subprocess creation using execve (#33983)
Move subprocess util to gpr.
Add support for communication with the subprocess.
This is required to support authentication using an executable.
2023-08-07 12:53:00 -07:00
Craig Tiller
5325b65d84 Revert "[core/gpr] move subprocess to gpr" (#33972)
Reverts grpc/grpc#33870 - since it breaks memory usage tooling.
2023-08-02 20:40:12 -07:00
Mario Jones Vimal
f10a8e3418 [core/gpr] move subprocess to gpr (#33870)
Move subprocess util to gpr.
Add support for communication with the subprocess.
This is required to support authentication using an executable.
2023-08-02 13:19:08 -07:00
Yijie Ma
a7bf07e86a [EventEngine] PosixEventEngine DNS Resolver (#32701)
This PR implements a c-ares based DNS resolver for EventEngine with the
reference from the original
[grpc_ares_wrapper.h](../blob/master/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h).
The PosixEventEngine DNSResolver is implemented on top of that. Tests
which use the client channel resolver API
([resolver.h](../blob/master/src/core/lib/resolver/resolver.h#L54)) are
ported, namely the
[resolver_component_test.cc](../blob/master/test/cpp/naming/resolver_component_test.cc)
and the
[cancel_ares_query_test.cc](../blob/master/test/cpp/naming/cancel_ares_query_test.cc).
The WindowsEventEngine DNSResolver will use the same EventEngine's
grpc_ares_wrapper and will be worked on next.

The
[resolve_address_test.cc](https://github.com/grpc/grpc/blob/master/test/core/iomgr/resolve_address_test.cc)
which uses the iomgr
[DNSResolver](../blob/master/src/core/lib/iomgr/resolve_address.h#L44)
API has been ported to EventEngine's dns_test.cc. That leaves only 2
tests which use iomgr's API, notably the
[dns_resolver_cooldown_test.cc](../blob/master/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc)
and the
[goaway_server_test.cc](../blob/master/test/core/end2end/goaway_server_test.cc)
which probably need to be restructured to use EventEngine DNSResolver
(for one thing they override the original grpc_ares_wrapper's free
functions). I will try to tackle these in the next step.
<!--

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-21 13:24:16 -07:00
Mark D. Roth
1432fe4e4c [JSON] make API public but experimental (#32987)
This makes the JSON API visible as part of the C-core API, but in the
`experimental` namespace. It will be used as part of various
experimental APIs that we will be introducing in the near future, such
as the audit logging API.
2023-05-09 08:05:24 -07:00
Mark D. Roth
844e740183 [JSON] Replace ctors with factory methods (#32834) 2023-05-02 09:22:42 -07:00
Esun Kim
c523bdac1e [C++] Added a cord support to gRPC protobuf serializer (#32617)
As Protobuf is going to support Cord to reduce memory copy when
[de]serializing Cord fields, gRPC is going to leverage it. This
implementation is based on the internal one but it's slightly modified
to use the public APIs of Cord. only
2023-04-19 08:55:25 -07:00
Mark D. Roth
9393cd887c [JSON] remove mutable accessor methods. (#32806)
Co-authored-by: markdroth <markdroth@users.noreply.github.com>
2023-04-06 13:37:42 -07:00
Mark D. Roth
36d2716d52 [JSON] move Parse() and Dump() methods out of JSON object (#32742)
More prep for making this a public API.
2023-03-30 13:30:54 -07:00
Mark D. Roth
656e5f283b [JSON] use updated style for enum values (#32741)
More preparation for making this a public API.
2023-03-30 09:39:07 -07:00
Mike Kruskal
b7e430174b Fix unused variable warning (#32616) 2023-03-14 13:04:12 -07:00
Eugene Ostroukhov
c62ecd5cb4 [testing]: Add "orca_per_rpc" test case (#32524) 2023-03-14 11:06:31 -07:00
Gregory Cooke
ca9e365002 Added verified_root_cert_subject pass up through cpp api (#32335)
PR #32215 added the verified root cert subject to the lower level
`tsi_peer`. This PR is a companion to that and completes the feature by
bubbling the information up to the `TsiCustomVerificationCheckRequest`
which is part of the user facing API for implementing custom
verification callbacks.
2023-03-08 13:41:26 -05: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
cut4th
aa2956b05b Change ProtoReflectionDescriptorDatabase to take grpc::ChannelInterface. (#31858)
Updates the ProtoReflectionDescriptorDatabase ctor to take a reference
to std::shared_ptr<grpc::ChannelInterface> rather than
std::shared_ptr<grpc::Channel>. This helps code that is making use of
grpc::ChannelInterface from having to perform a cast from the Base to
the Derived when creating the refelction db.
2023-01-06 18:05:38 -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
1b05576aa3 [cleanups] Clean up GrpcLibraryInitializer (#31894)
* Clean up `GrpcLibraryInitializer`

* Update

* Automated change: Fix sanity tests
2022-12-17 01:08:35 +08:00
Cheng-Yu Chung
5fe132a211 Revert "Revert "Remove include/grpc/impl/codegen/gpr_slice.h (#31774)" (#31805)" (#31806)
This reverts commit 39a4343044.

Fixing forward the original PR. The content should be the same as the original PR. The broken part is in the internal.
2022-12-07 00:43:18 +08:00
Cheng-Yu Chung
39a4343044 Revert "Remove include/grpc/impl/codegen/gpr_slice.h (#31774)" (#31805)
This reverts commit ac1dee8ac1.
2022-12-05 11:11:42 -08:00
Cheng-Yu Chung
ac1dee8ac1 Remove include/grpc/impl/codegen/gpr_slice.h (#31774) 2022-12-06 02:33:11 +08:00
Esun Kim
f3fedae7c8 Added readability-redundant-string-cstr (#31707)
* Added readability-redundant-string-cstr

* Auto fix

* No need to wrap std::string
2022-11-18 17:12:46 -08:00
Esun Kim
0ba0c4bf74 Added googletest clang-tidy checks (#31610)
* Added google-googletest

* Autofix

* Fix test names

* Fix
2022-11-18 13:02:20 -08:00
Esun Kim
250f9fc026 Revived google-readability-casting (#31607)
* Added google-readability-casting

* Fix

* Use brace init for constants

* more

* Fix

* Fix 2

* More fix

* Fixf
2022-11-11 16:44:37 -08:00
Esun Kim
530b702259 Update Clang 15 (#31518)
* clang-15

* iwyu

* run clang_format_code

* Clang-Tidy config

* Fix misc-unused-using-decls

* Fixed performance-inefficient-vector-operation

* Sanity
2022-11-04 09:08:03 -07:00
Micah Paul Ramos
1f0c6a6748 fix gprc_cli segfault when using binary in and out (#31411) 2022-10-21 12:05:33 -07:00