Commit Graph

109 Commits

Author SHA1 Message Date
Tanvi Jagtap
986428d252 [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - gpr_log (#36636)
[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 #36636

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36636 from tanvi-jagtap:regex_test_cpp f2cac9c5a49f8d6025989160b9d9d6954dc8cc2d
PiperOrigin-RevId: 634954173
2024-05-17 20:10:09 -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
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
AJ Heller
c0208416b6 Automated rollback of commit 82e5116fb0.
PiperOrigin-RevId: 632241053
2024-05-09 12:54:02 -07:00
AJ Heller
82e5116fb0 Automated rollback of commit f45ac2c9e4.
PiperOrigin-RevId: 630539205
2024-05-03 17:30:40 -07:00
AJ Heller
f45ac2c9e4 Reland: [surface] Add an API to inject connected endpoints into servers
PiperOrigin-RevId: 630095574
2024-05-02 10:00: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
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
gRPC Team Bot
6dc64db1a8 Automated rollback of commit f61049f641.
PiperOrigin-RevId: 626062841
2024-04-18 09:43:26 -07:00
AJ Heller
f61049f641 [surface] Reland: Add an API to inject connected endpoints into servers
PiperOrigin-RevId: 625837807
2024-04-17 16:17:51 -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
798399b984 Automated rollback of commit 7c57fb70e9.
PiperOrigin-RevId: 622990471
2024-04-08 17:03:32 -07:00
AJ Heller
7c57fb70e9 [surface] Add an API to inject connected endpoints into servers (#35957)
Closes #35957

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35957 from drfloob:endpoint-infusion abdb9939c5bbed459182495f6272965aed8ecca8
PiperOrigin-RevId: 622939183
2024-04-08 13:42:57 -07:00
Luwei Ge
dd12460018 [tls] Add set min/max TLS version APIs to TLS credentials APIs. (#34861)
Address #28382. This is a recreation of #31368 except e2e tests are not handled here (yet).

Closes #34861

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/34861 from rockspore:tls_version f9a1215ac1291722dba4f22cedc128c241aa3cab
PiperOrigin-RevId: 589847110
2023-12-11 09:27:44 -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
Gregory Cooke
a4f345ff96 TlsCreds: Support revocation of intermediate in chain. (#32544)
This PR is a small code change with a lot of new test data.
[In OpenSSL, there are two flags that configure CRL checks. Coping
relevant
section:](https://www.openssl.org/docs/man1.0.2/man3/X509_VERIFY_PARAM_get_depth.html)

> - X509_V_FLAG_CRL_CHECK enables CRL checking for the certificate chain
leaf certificate. An error occurs if a suitable CRL cannot be found.
> - X509_V_FLAG_CRL_CHECK_ALL enables CRL checking for the entire
certificate chain.

We currently only set `X509_V_FLAG_CRL_CHECK`, so we will only ever
check if the leaf certificate is revoked. We should check the whole
chain. I am open to making this a user configuration if we want to do it
that way, but we certainly need to be able to check the whole chain.

So, this PR contains the small code change in
`ssl_transport_security.cc` to use the `X509_V_FLAG_CRL_CHECK_ALL` flag.
Then the rest of the changes are in tests. I've added all the necessary
files to have a chain built that looks as follows
`Root CA -> Revoked Intermediate CA -> Leaf Certificate`, and added a
test for this case as well.
You can verify that on master this new test will fail (i.e. the
handshake will succeed even though the intermediate CA is revoked) by
checking out this branch, running `git checkout master --
./src/core/tsi/ssl_transport_security.cc`, then running the test.

I also slightly reorganized test/core/tsi/test_creds/ so that the CRLs
are in their own directory, which is the way our API intends to accept
CRLs.
2023-03-23 11:34:59 -04:00
Yijie Ma
ac7faf75ba Fix a race on vptr for UnimplementedAsyncRequest (#32547)
It is reported in https://github.com/grpc/grpc/issues/32356 that there
is a race on vptr for `UnimplementedAsyncRequest` which would cause
crashes for multi-threaded server if clients send unimplemented RPC
request to the server.

The cause is that the server requests a call for
`UnimplementedAsyncRequest` in its base class `GenericAsyncRequest` when
the `vptr` still points to the base class's `vtable`. If the call went
in and another server thread picks up the tag before the `vptr` points
back to the derived class's `vtable`, it would call the wrong virtual
function and also this is a data race. This fix makes the request of the
call inside the derived class's constructor.

<!--

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-10 13:00:56 -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
Cheng-Yu Chung
ac365cadfb Remove include/grpc/impl/codegen/port_platform.h (#31778) 2022-12-14 10:46:33 +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
660a6f281e Added readability-redundant-string-init (#31609)
* Added readability-redundant-string-init

* Fix
2022-11-10 11:14:36 -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
Yash Tibrewal
5f6c357e74 Move some targets from //: to //src/core: (#31402)
* temp

* temp

* temp

* top BUILD builds

* everything builds

* buildify

* temp fix_build_deps change

* fix gpr_atm

* additional changes

* fix build files

* nofixdeps

* Generate projects

* json_args

* fix context

* Generate projects

* Sprinkle some avoid_dep tags

* Run fix_build_deps

* Remove additional avoid_dep

* Revert some targets

* grpc_mock_cel
2022-10-20 20:12:53 -07:00
Cheng-Yu Chung
a192f155b9 Remove include/grpcpp/impl/codegen/config.h (#31061)
* Remove `include/grpcpp/impl/codegen/config.h`

* Update
2022-10-06 13:14:16 -04:00
Craig Tiller
9c98d67d7a [c++14] absl::make_unique --> std::make_unique (#31159)
* [c++14] absl::make_unique --> std::make_unique

* fix

* fix
2022-09-29 06:45:17 -07:00
Craig Tiller
b463cabeec Update flaky tests (#30873)
* Update flaky tests list

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-09-07 10:16:34 -07:00
Craig Tiller
f573fd44f9 [test] Semi-automatic flaky test tracking (#30638)
* [test] Semi-automatic flaky test tracking

* fix

* Automated change: Fix sanity tests

* Update update_flakes.py

* fix formatting

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-08-19 16:22:31 -07: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
Esun Kim
c66c362191 Reland "Enable GRPC_ERROR_IS_ABSEIL_STATUS" (#30047)
* Revert "Revert "Enable GRPC_ERROR_IS_ABSEIL_STATUS (#29869)" (#30031)"

This reverts commit 2d0d1775a9.

* Fix the test
2022-06-23 12:38:19 -07:00
Esun Kim
2d0d1775a9 Revert "Enable GRPC_ERROR_IS_ABSEIL_STATUS (#29869)" (#30031)
This reverts commit c6058b5e6b.
2022-06-15 21:41:55 -07:00
Esun Kim
c6058b5e6b Enable GRPC_ERROR_IS_ABSEIL_STATUS (#29869)
* Enable GRPC_ERROR_IS_ABSEIL_STATUS

* Sanitize

* Fix ServerRequestCallTest
2022-06-15 15:06:15 -07:00
Craig Tiller
0f9d024fec [iwyu] c++ (#29721)
* Revert "Revert "[iwyu] grpc++ (#29610)" (#29720)"

This reverts commit 0642bc213d.

* fixup status_code_enum import issue

* fix

* Automated change: Fix sanity tests

* import fixes

* fix import

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-05-19 07:34:48 -07:00
Craig Tiller
0642bc213d Revert "[iwyu] grpc++ (#29610)" (#29720)
This reverts commit c8159eabdf.
2022-05-18 09:58:08 -07:00
Craig Tiller
c8159eabdf [iwyu] grpc++ (#29610)
* [iwyu] grpc++

* fix

* fix

* Automated change: Fix sanity tests

* fix

* fix

* fix

* [iwyu] Better script

* eliminate race

* fixes

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-05-18 07:16:53 -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
krestofur
1cdcd88fb1 Add experimental API for CRL checking support to gRPC C++ TlsCredentials (#28407) 2022-01-26 20:23:48 -08:00
ZhenLian
2e14f6fa70 Support Custom Post-handshake Verification in TlsCredentials (#25631)
* custom verification refactoring - post-handshake verification
2021-11-10 13:45:52 -08:00
Richard Belleville
468768865b Make Buildifier Sanity Test Strict (#27807)
* Fix all lint errors in repo.

* Use strict buildifier by default

* Whoops. That file does not exist

* Attempt fix to buildifier invocation

* Add missing copyright
2021-11-03 14:57:04 -07:00
Mark D. Roth
e251ee9ffb disable authorization_policy_provider_test on iOS (#27927) 2021-11-03 11:55:32 -07:00
Ashitha Santhosh
a1db97be90 Revert "Revert "Revert "Revert "File watcher authorization policy provider implementation"" (#27605)" (#27644)" (#27645)
This reverts commit b8e01f73a0.
2021-10-08 15:52:13 -07:00
AJ Heller
b8e01f73a0 Revert "Revert "Revert "File watcher authorization policy provider implementation"" (#27605)" (#27644)
This reverts commit 5912aedb2b.
2021-10-07 16:45:30 -07:00
Ashitha Santhosh
5912aedb2b Revert "Revert "File watcher authorization policy provider implementation"" (#27605)
* Revert "Revert "File watcher authorization policy provider implementation (#26779)" (#27591)"

This reverts commit a1ad74f7af.

* Remove license comment
2021-10-07 09:54:23 -07:00
Craig Tiller
d1e01ac139 Add a test for a (now-illegal) build file construct (#27602)
* Add a test for a (now-illegal) build file construct

* add to test suite!

* fix

* fix

* fix syntax
2021-10-06 07:43:59 -07:00