631 Commits

Author SHA1 Message Date
Jordan Rupprecht
41780cddd1 Avoid multimap::find unspecified behavior (#41279)
When a `std::multimap` has multiple entries with the same key, calling `m.find(key)` returns an unspecified element.

Historically, this returns the first matching element. However, this is not guaranteed, and recent libc++ changes make this return an arbitrary element.

Using `m.equal_range(key)` is a replacement that will preserve the current behavior. The behavior of this is guaranteed to return a range of all matching elements in insertion order, and the beginning of the range is the same element as what's normally returned by `m.find(key)`.

Closes #41279

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/41279 from rupprecht:multimap-find 70b116441d03eff80523e010b25336f5a75c70c2
PiperOrigin-RevId: 852844558
2026-01-06 10:44:32 -08:00
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
Mark D. Roth
df27c82ab5 [LB] remove SubchannelCallTrackerInterface::Start() method (#41099)
This is needed for gRFC A105 (https://github.com/grpc/proposal/pull/516).  Specifically, see the "Interaction with xDS Circuit Breaking" section.

It's possible for an LB pick to be happening at the same time as the subchannel sees its underlying connection fail.  In this case, the picker can return a subchannel, but when the channel tries to start a call on the subchannel, the call creation fails, because there is no underlying connection.  In that case, the channel will queue the pick, on the assumption that the LB policy will soon notice that the subchannel has been disconnected and return a new picker, at which point the queued pick will be re-attempted with that new picker.

When the picker returns a complete pick, it can optionally return a `SubchannelCallTracker` object that allows it to see when the subchannel call starts and ends.  In the current API, when the channel successfully creates a call on the subchannel, it will immediately call `Start()`, and then when the subchannel call later ends, it will call `Finish()`.  However, when the race condition described above occurs, the `SubchannelCallTracker` object will be destroyed without `Start()` or `Finish()` ever having been called.  This API allows us to handle call counter incrementing and decrementing for things like xDS circuit breaking: we check the counter in the picker to see that it's currently below the limit, we increment the counter in `Start()`, and decrement it in `Finish()`.  If the subchannel call never starts, then the counter never gets incremented.

With the introduction of connection scaling functionality in the subchannel, this approach will no longer work, because the call may be queued inside of the subchannel rather than being immediately started on a connection, and the channel can't tell if that is going to happen.  In other words, there's no longer any benefit to the `Start()` method, because it will no longer actually indicate that the call is actually being started on a connection.  As a result, I am removing that method from the API.

For xDS circuit breaking in the xds_cluster_impl LB policy, we are now incrementing the call counter in the picker, and the `SubchannelCallTracker` object will decrement it when either `Finish()` is called or when the object is destroyed, whichever comes first.

For grpclb, the `Start()` method was used in an ugly hack to handle ownership of the client stats object between the grpclb policy and the client load reporting filter.  The LB policy passes a pointer to this object down to the filter via client initial metadata, which contains a raw pointer and does not hold a ref.  To handle ownership, the LB policy returns a `SubchannelCallTracker` that holds a ref to the client stats object, but when `Start()` is called, it releases that ref, on the assumption that the client load reporting filter will subsequently take ownership.  I've replaced this with a slightly cleaner approach whereby the call tracker always holds a ref to the client stats object, thus guaranteeing that the client stats object exists when the client load reporting filter sees it, and the client load reporting filter takes its own ref when it runs.  (An even cleaner approach would be to instead pass the client stats object to the filter via a call attribute, similar to how we pass the xDS cluster name from the ConfigSelector to the LB policy tree, but it doesn't seem worth putting that much effort into grpclb at this point.)

Closes #41099

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/41099 from markdroth:xds_circuit_breaking_counter_change eaa06bbdf1688c31c0d1e3b3cabe6a7d015fc075
PiperOrigin-RevId: 842261731
2025-12-09 09:02:30 -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
30bbb567bd [build] Add Missing Dependencies for memstats, counted_service, xds_server, server_helper_lib, interop_server_lib, client_helper_lib, interop_client_main, grpc_cli, grpc_cli_libs in Preparation for Enabling layering_check
PiperOrigin-RevId: 802614113
2025-09-03 10:43:14 -07:00
Rishesh Agarwal
ed7eaa5e54 update deps for eventmanager's build
PiperOrigin-RevId: 802499797
2025-09-03 04:40:04 -07:00
Rishesh Agarwal
9d212b68c1 Update cpp/common, ext/otel, cpp/interop deps for layering_check and parse_headers
PiperOrigin-RevId: 802415268
2025-09-02 23:07:41 -07:00
Rishesh Agarwal
e2640c46d1 [build] Add Missing Dependencies for test/cpp/interop, test/cpp/server, test/cpp/thread_manager, test/cpp/util in Preparation for Enabling layering_check
PiperOrigin-RevId: 797690724
2025-08-21 03:36:51 -07:00
AJ Heller
ff8461db74 Begin moving gRPC socket_mutator files out of the iomgr folder
PiperOrigin-RevId: 792247693
2025-08-07 11:51:02 -07:00
Tanvi Jagtap - Google LLC
303de80c54 [Copybara] Making includes uniform . This is for build layering (#40388)
[Copybara] Making includes uniform . This is for build layering

Closes #40388

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/40388 from tanvi-jagtap:ph2_settings bc30d3d013b0ac2b4f55e9040a2d2b8e25b42cdc
PiperOrigin-RevId: 791205698
2025-08-05 07:32:28 -07:00
Eugene Ostroukhov
c0bafca6f3 [test] Unflake //t...c...i/backend_metrics_lb_policy_test.cc (#39459)
Closes #39459

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/39459 from eugeneo:fix-flaky-backend_metrics_lb_policy_test 2ced23c94a1fc87afc38649930caf600a0b1cf70
PiperOrigin-RevId: 754056311
2025-05-02 10:45:37 -07:00
Craig Tiller
2e10452ffb Split CoreConfiguration builders into two buckets: ephemeral and persistent.
We use builders for a variety of tasks - sometimes for testing, sometimes for adapting gRPC to novel environments, sometimes for once off special tasks early in a process lifetime.

Treating these as the same thing has started leading to some problems, so here I introduce a reset-proof registration for a subset of these tasks.

I'll be using this to register chaotic-good into the EndpointTransport registry so that it doesn't need to join the usual core configuration chain (and accidentally pull in protobuf to core).

PiperOrigin-RevId: 750048742
2025-04-21 22:38:04 -07:00
Mark D. Roth
c5a847c5b0 [reorg] move files to src/core/call (#38888)
This moves files from various locations to their new home in src/core/call.

Closes #38888

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38888 from markdroth:reorg_call fec9f5b1b0cecf02726b235fb86416e857404ad3
PiperOrigin-RevId: 735853779
2025-03-11 12:45:53 -07:00
Craig Tiller
48274038e2 Use tagging to flag broken internal libraries
PiperOrigin-RevId: 733145986
2025-03-03 19:34:07 -08: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
Mark D. Roth
076d5076c6 [reorg] move security base APIs and credential code to new locations (#38825)
This includes the following moves from src/core/lib/security:
- certificate_provider/* → src/core/credentials/transport/tls/
- context/* → split between src/core/call/security_context* and src/core/transport/auth_context*
- credentials/
  - composite/ → split between src/core/credentials/call/composite/ and src/core/credentials/transport/composite/
  - alts, google_default, insecure, local, ssl, tls, xds → src/core/credentials/transport/
  - fake/ → split between test/core/test_util/test_call_creds* and src/core/credentials/transport/fake
  - external, iam, jwt, oauth2, plugin, token_fetcher → src/core/credentials/call/
  - call_creds_utils.* → src/core/credentials/call/
  - channel_creds_registry* → src/core/credentials/transport/
  - credentials.* → split between src/core/credentials/call/call_credentials.* and src/core/credentials/transport/transport_credentials.*
- security_connector/
  - alts, fake, insecure, local, ssl, tls → src/core/credentials/transport/
  - security_connector* → src/core/credentials/transport/
  - ssl_utils*, load_system_roots* → src/core/credentials/transport/tls/
- transport/ → src/core/filter/auth/
- util/* → src/core/credentials/call/

The only thing left in src/core/lib/security is the authz code, which I will move in a separate PR.

I have also moved the tests from test/core/security into a similar structure.  Some specific notes:
- I have removed print_google_default_creds_token.cc, since it does not appear in any build file and appears to be completely unused.
- I moved secure_endpoint_test.cc to test/core/handshaker, to match where the implementation lives in the tree.

Closes #38825

PiperOrigin-RevId: 731487339
2025-02-26 16:01:37 -08:00
Craig Tiller
75dc0511e8 [interop] Change time query from PRECISE to MONOTONIC (#38771)
This almost certainly doesn't need the PRECISE clock type, and is the only call site to use it right now.
Once this is gone we can remove GPR_CLOCK_PRECISE, and then an entire timer subsystem that backs it.

Closes #38771

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38771 from ctiller:goonbag c7a5e3aa3115f966c3c6ae3aadbfb7804a47a931
PiperOrigin-RevId: 729155584
2025-02-20 10:10:22 -08:00
Yash Tibrewal
c637de558a [Cleanup] Avoid std::make_pair (#38636)
Maybe in some of these cases, `{}` would work instead of `std::pair`, but I'm just doing a simple find and replace here.

Closes #38636

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38636 from yashykt:NoMakePair d819f6a74be2fb2859083436297f79ed3139a1b7
PiperOrigin-RevId: 722772621
2025-02-03 13:19:08 -08:00
Pawan Bhardwaj
d590875bc3 [Cleanup] Avoid std::make_tuple (#38643)
C++17 : Template argument deduction for class templates

Closes #38643

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38643 from pawbhard:cleanup-tuple dcd211ff5b824d2854c4de5e26e96d61619fa1b3
PiperOrigin-RevId: 721806200
2025-01-31 09:53:08 -08:00
Yash Tibrewal
87ba39900a [XdsInteropClient] Remove incorrect behavior around keep-open (#38613)
Based on the [spec](https://github.com/grpc/grpc/blob/master/doc/xds-test-descriptions.md#server) and the [reference Java implementation](https://github.com/grpc/grpc-java/blob/master/interop-testing/src/main/java/io/grpc/testing/integration/XdsTestClient.java), it's the server that needs to honor the "keep-open" behavior and not the client.

(I'm not changing the server's behavior in this PR, since we are not using C++ servers and instead using Java servers for the concerned tests.)

Closes #38613

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38613 from yashykt:FixXdsInteropClientBehavior 99556ba8f7d3e5481750fb91eee9683d838cf182
PiperOrigin-RevId: 720999079
2025-01-29 09:07:40 -08:00
Craig Tiller
725d1eea73 [build] Remove language tag from BUILD files (#38501)
This is only ever set to C++, so removing it from bazel.

There are remnants left in cmakefile generation that I'm not planning on cleaning up (looked like some of the yaml/python pieces still use this)

Closes #38501

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38501 from ctiller:language c8aee06a01a449483b7585a367ff793fde47f68a
PiperOrigin-RevId: 718198572
2025-01-21 21:13:44 -08:00
AJ Heller
478b4c0fba [C++17] Replace absl::optional with std::optional (#38420)
Closes #38420

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38420 from drfloob:cpp17-optional 7f276aaa3c493a2ea7f4f1766da975e083914a5b
PiperOrigin-RevId: 715081837
2025-01-13 13:13:38 -08:00
AJ Heller
bd13a27610 [C++17] Replace absl::variant with std::variant (#38419)
absl::variant is a C++11 compatible shim for C++17's std::variant. See 2f016c4575/absl/types/variant.h (L38-L40).

Closes #38419

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38419 from drfloob:cpp17-variant 914ffd48413138458097b4726f89a58a48717154
PiperOrigin-RevId: 713817791
2025-01-09 15:38:32 -08:00
Mark D. Roth
b6910266d7 [PSM interop client] add flag to log RPC start and end (#38355)
Closes #38355

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38355 from markdroth:xds_interop_client_logging ecc27550e57659aebb0f3837d7e0a772fe9f9c09
PiperOrigin-RevId: 710092132
2024-12-27 10:37:38 -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
Yash Tibrewal
c333d60fcd [OTel] Set prometheus exporter option to populate otel scope (#38170)
Fix #38169

Closes #38170

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38170 from yashykt:OpenTelMetricsOptions 8ea4ed82ede26552eb6d9381a621dad01bb8e0d7
PiperOrigin-RevId: 698849889
2024-11-21 11:17:44 -08: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
Nathan Baulch
b2a05bebe0 [maintenance] Fix cpp typos (#37755)
Continuation of #37541 but focused on C++.

Closes #37755

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37755 from NathanBaulch:typos-cpp 9a7fd9d65fa97a689d529772534df1a501031e9f
PiperOrigin-RevId: 684600898
2024-10-10 15:37:18 -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
Tanvi Jagtap
3c928436b4 [Gpr_To_Absl_Logging] Remove logging header from example and test/cpp folder (#37488)
[Gpr_To_Absl_Logging] Remove logging header from example and test/cpp folder

Closes #37488

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37488 from tanvi-jagtap:remove_header_examples 1423ee77fff3136f3157993c07a5288552768e0d
PiperOrigin-RevId: 663597077
2024-08-15 22:13:08 -07:00
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
Tanvi Jagtap
7091890ae7 [Gpr_To_Absl_Logging] [Gpr_To_Absl_Logging] Minor log formatting fixes
PiperOrigin-RevId: 648665041
2024-07-02 04:05:42 -07:00
Eugene Ostroukhov
5ff56f6bcf [test] Increase timeout in pre_stop_hook_server_test (#37126)
Closes #37126

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37126 from eugeneo:increase-timeout-hook-test 190cd3d60ca219660985958e132c7e7bf6072837
PiperOrigin-RevId: 648415617
2024-07-01 10:38:26 -07:00
Mark D. Roth
24318054bc [LB policy API] change metadata mutations to overwrite instead of append (#37075)
Closes #37075

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37075 from markdroth:lb_metadata_overwrite 1f56d2001e64e336df1615b4804a83419d911414
PiperOrigin-RevId: 647761256
2024-06-28 12:18:40 -07:00
Mark D. Roth
34a0318dbf [LB policy API] change metadata mutation API to handle discarded picks (#36968)
Previously, metadata mutations were made by the picker directly, which meant that they would be applied even if the channel winds up discarding the pick due to the returned subchannel having been disconnected by the time the pick result is returned.  This changes the API such that pickers return metadata mutations along with the pick result, so that the mutations won't get applied unless the pick result is actually used.

Closes #36968

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36968 from markdroth:lb_metadata_api 2765da61214f3ae63da3fdb8e362fac625b51c5a
PiperOrigin-RevId: 645451869
2024-06-21 11:35:39 -07:00
Tanvi Jagtap
b4fa67a452 [Gpr_To_Absl_Logging] Remove unused declaration of gpr_default_log.
This was removed as a part of gpr to absl migration.

PiperOrigin-RevId: 643863973
2024-06-16 20:55:53 -07:00
Tanvi Jagtap
03e91b6811 [Gpr_To_Absl_Logging] Move function to test header form log.h (#36860)
[Gpr_To_Absl_Logging] Move function to test header form log.h
This is not really needed in log.h

Closes #36860

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36860 from tanvi-jagtap:move_function_to_test_header e6494bd06f2e4a08c91eb41f420607f9568b22ac
PiperOrigin-RevId: 642080756
2024-06-10 17:52:44 -07:00
Tanvi Jagtap
1dbfd4c9f2 [grpc][Gpr_To_Absl_Logging] Deleting multiple instances of gpr_set_log_function (#36833)
Deleting multiple instances of gpr_set_log_function .
This function will be deleted soon.
https://github.com/grpc/proposal/pull/425

Closes #36833

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36833 from tanvi-jagtap:remove_gpr_log_partial_code 17517efee4795eb6e5ff7670252e7329c9cf12d7
PiperOrigin-RevId: 641268299
2024-06-07 09:14:44 -07:00
Yash Tibrewal
c495d2aa1f [CSM] Stop using xDS enabled server for CSM observability tests (#36725)
Closes #36725

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36725 from yashykt:RemoveXdsEnabledServerFromCsmInterop 91f3120f078068979274881bc02b7cd5905c61e5
PiperOrigin-RevId: 638313782
2024-05-29 09:36:43 -07:00
Tanvi Jagtap
d148728588 Use LOG_IF(FATAL, ...) instead of gpr_assertion_failed() in interop_client.cc
gpr_assertion_failed() will be deprecated soon.

LOG_IF(FATAL, condition) will terminate if condition is true.

PiperOrigin-RevId: 636770885
2024-05-23 20:48:30 -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
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
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
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
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