Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT #36467

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2861763
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap Apr 26, 2024
37da103
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap Apr 28, 2024
5fb6432
Merge branch 'master' into tjagtap_src_core_lib
tanvi-jagtap Apr 28, 2024
ce5d62d
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap Apr 28, 2024
200be83
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap Apr 28, 2024
6a12b52
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap Apr 28, 2024
a1ea143
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap Apr 28, 2024
282cd8b
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap Apr 28, 2024
26cbdfa
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap Apr 28, 2024
cad94a5
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap Apr 28, 2024
80da867
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap Apr 28, 2024
a5ccaf0
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap Apr 28, 2024
7a588c0
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap Apr 28, 2024
7abfce4
Merge branch 'master' into tjagtap_src_core_lib
tanvi-jagtap Apr 29, 2024
9bd661b
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap Apr 29, 2024
da1e62b
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap Apr 29, 2024
8b7c6be
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap Apr 29, 2024
58c050c
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap Apr 30, 2024
c34a771
Merge branch 'master' into tjagtap_src_core_lib
tanvi-jagtap Apr 30, 2024
fb63aa0
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap Apr 30, 2024
7850d1d
Merge branch 'master' into tjagtap_src_core_lib
tanvi-jagtap Apr 30, 2024
b1f9b04
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap Apr 30, 2024
cf5e63f
Merge branch 'master' into tjagtap_src_core_lib
tanvi-jagtap Apr 30, 2024
e117683
Merge branch 'master' into tjagtap_src_core_lib
tanvi-jagtap May 1, 2024
087d11d
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap May 1, 2024
0f9b756
Merge branch 'master' into tjagtap_src_core_lib
tanvi-jagtap May 1, 2024
4fc5a90
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap May 1, 2024
7b7f345
Merge branch 'tjagtap_src_core_lib' of https://github.com/tanvi-jagta…
tanvi-jagtap May 1, 2024
ab830ad
Merge branch 'master' into tjagtap_src_core_lib
tanvi-jagtap May 1, 2024
30d3ff5
[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_AS…
tanvi-jagtap May 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILD
Expand Up @@ -2982,7 +2982,6 @@ grpc_cc_library(
deps = [
"gpr_platform",
"//src/core:env",
"//src/core:gpr_log_internal",
],
)

Expand Down Expand Up @@ -3099,6 +3098,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/container:inlined_vector",
"absl/log:check",
"absl/status",
"absl/strings:str_format",
],
Expand Down
1 change: 0 additions & 1 deletion Package.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion build_autogenerated.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions gRPC-C++.podspec

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions gRPC-Core.podspec

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion grpc.gemspec

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions src/core/BUILD
Expand Up @@ -288,15 +288,6 @@ grpc_cc_library(
],
)

grpc_cc_library(
name = "gpr_log_internal",
hdrs = [
"lib/gpr/log_internal.h",
],
language = "c++",
deps = ["//:gpr_platform"],
)

grpc_cc_library(
name = "env",
srcs = [
Expand Down Expand Up @@ -1250,6 +1241,7 @@ grpc_cc_library(
],
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/status",
"absl/status:statusor",
"absl/types:optional",
Expand Down Expand Up @@ -2839,7 +2831,10 @@ grpc_cc_library(
"lib/transport/bdp_estimator.cc",
],
hdrs = ["lib/transport/bdp_estimator.h"],
external_deps = ["absl/strings"],
external_deps = [
"absl/log:check",
"absl/strings",
],
deps = [
"time",
"//:gpr",
Expand Down Expand Up @@ -7065,6 +7060,7 @@ grpc_cc_library(
],
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/status",
"absl/status:statusor",
"absl/types:optional",
Expand Down Expand Up @@ -7266,6 +7262,9 @@ grpc_cc_library(
hdrs = [
"lib/transport/call_filters.h",
],
external_deps = [
"absl/log:check",
],
deps = [
"call_final_info",
"latch",
Expand Down Expand Up @@ -7373,6 +7372,9 @@ grpc_cc_library(
hdrs = [
"lib/transport/call_spine.h",
],
external_deps = [
"absl/log:check",
],
deps = [
"1999",
"call_arena_allocator",
Expand Down Expand Up @@ -7407,6 +7409,7 @@ grpc_cc_library(
"absl/container:flat_hash_set",
"absl/container:inlined_vector",
"absl/functional:function_ref",
"absl/log:check",
"absl/meta:type_traits",
"absl/strings",
"absl/strings:str_format",
Expand Down Expand Up @@ -7441,6 +7444,7 @@ grpc_cc_library(
],
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/types:optional",
],
deps = [
Expand Down
5 changes: 3 additions & 2 deletions src/core/handshaker/handshaker.cc
Expand Up @@ -23,6 +23,7 @@
#include <string>
#include <utility>

#include "absl/log/check.h"
#include "absl/status/status.h"
#include "absl/strings/str_format.h"

Expand Down Expand Up @@ -100,7 +101,7 @@ bool HandshakeManager::CallNextHandshakerLocked(grpc_error_handle error) {
this, StatusToString(error).c_str(), is_shutdown_, index_,
HandshakerArgsString(&args_).c_str());
}
GPR_ASSERT(index_ <= handshakers_.size());
CHECK(index_ <= handshakers_.size());
// If we got an error or we've been shut down or we're exiting early or
// we've finished the last handshaker, invoke the on_handshake_done
// callback. Otherwise, call the next handshaker.
Expand Down Expand Up @@ -177,7 +178,7 @@ void HandshakeManager::DoHandshake(grpc_endpoint* endpoint,
bool done;
{
MutexLock lock(&mu_);
GPR_ASSERT(index_ == 0);
CHECK_EQ(index_, 0u);
// Construct handshaker args. These will be passed through all
// handshakers and eventually be freed by the on_handshake_done callback.
args_.endpoint = endpoint;
Expand Down
5 changes: 3 additions & 2 deletions src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc
Expand Up @@ -21,6 +21,7 @@
#include <memory>

#include "absl/base/thread_annotations.h"
#include "absl/log/check.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/types/optional.h"
Expand Down Expand Up @@ -124,7 +125,7 @@ void TCPConnectHandshaker::DoHandshake(grpc_tcp_server_acceptor* /*acceptor*/,
MutexLock lock(&mu_);
on_handshake_done_ = on_handshake_done;
}
GPR_ASSERT(args->endpoint == nullptr);
CHECK_EQ(args->endpoint, nullptr);
args_ = args;
absl::StatusOr<URI> uri = URI::Parse(
args->args.GetString(GRPC_ARG_TCP_HANDSHAKER_RESOLVED_ADDRESS).value());
Expand Down Expand Up @@ -179,7 +180,7 @@ void TCPConnectHandshaker::Connected(void* arg, grpc_error_handle error) {
}
return;
}
GPR_ASSERT(self->endpoint_to_destroy_ != nullptr);
CHECK_NE(self->endpoint_to_destroy_, nullptr);
self->args_->endpoint = self->endpoint_to_destroy_;
self->endpoint_to_destroy_ = nullptr;
if (self->bind_endpoint_to_pollset_) {
Expand Down
1 change: 0 additions & 1 deletion src/core/lib/config/load_config.cc
Expand Up @@ -24,7 +24,6 @@

#include <grpc/support/port_platform.h>

#include "src/core/lib/gpr/log_internal.h"
#include "src/core/lib/gprpp/env.h"

namespace grpc_core {
Expand Down
55 changes: 0 additions & 55 deletions src/core/lib/gpr/log_internal.h

This file was deleted.

8 changes: 5 additions & 3 deletions src/core/lib/transport/batch_builder.cc
Expand Up @@ -16,6 +16,8 @@

#include <type_traits>

#include "absl/log/check.h"

#include <grpc/support/port_platform.h>

#include "src/core/lib/promise/poll.h"
Expand Down Expand Up @@ -96,13 +98,13 @@ BatchBuilder::Batch* BatchBuilder::GetBatch(Target target) {
batch_ = GetContext<Arena>()->NewPooled<Batch>(payload_,
target_->stream_refcount);
}
GPR_ASSERT(batch_ != nullptr);
CHECK_NE(batch_, nullptr);
return batch_;
}

void BatchBuilder::FlushBatch() {
GPR_ASSERT(batch_ != nullptr);
GPR_ASSERT(target_.has_value());
CHECK_NE(batch_, nullptr);
CHECK(target_.has_value());
if (grpc_call_trace.enabled()) {
gpr_log(
GPR_DEBUG, "%sPerform transport stream op batch: %p %s",
Expand Down
4 changes: 3 additions & 1 deletion src/core/lib/transport/bdp_estimator.cc
Expand Up @@ -23,6 +23,8 @@

#include <algorithm>

#include "absl/log/check.h"

#include <grpc/support/port_platform.h>

grpc_core::TraceFlag grpc_bdp_estimator_trace(false, "bdp_estimator");
Expand Down Expand Up @@ -53,7 +55,7 @@ Timestamp BdpEstimator::CompletePing() {
std::string(name_).c_str(), accumulator_, estimate_, dt,
bw / 125000.0, bw_est_ / 125000.0);
}
GPR_ASSERT(ping_state_ == PingState::STARTED);
CHECK(ping_state_ == PingState::STARTED);
if (accumulator_ > 2 * estimate_ / 3 && bw > bw_est_) {
estimate_ = std::max(accumulator_, estimate_ * 2);
bw_est_ = bw;
Expand Down
5 changes: 3 additions & 2 deletions src/core/lib/transport/bdp_estimator.h
Expand Up @@ -23,6 +23,7 @@

#include <string>

#include "absl/log/check.h"
#include "absl/strings/string_view.h"

#include <grpc/support/log.h>
Expand Down Expand Up @@ -54,7 +55,7 @@ class BdpEstimator {
gpr_log(GPR_INFO, "bdp[%s]:sched acc=%" PRId64 " est=%" PRId64,
std::string(name_).c_str(), accumulator_, estimate_);
}
GPR_ASSERT(ping_state_ == PingState::UNSCHEDULED);
CHECK(ping_state_ == PingState::UNSCHEDULED);
ping_state_ = PingState::SCHEDULED;
accumulator_ = 0;
}
Expand All @@ -67,7 +68,7 @@ class BdpEstimator {
gpr_log(GPR_INFO, "bdp[%s]:start acc=%" PRId64 " est=%" PRId64,
std::string(name_).c_str(), accumulator_, estimate_);
}
GPR_ASSERT(ping_state_ == PingState::SCHEDULED);
CHECK(ping_state_ == PingState::SCHEDULED);
ping_state_ = PingState::STARTED;
ping_start_time_ = gpr_now(GPR_CLOCK_MONOTONIC);
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/lib/transport/call_destination.h
Expand Up @@ -36,7 +36,7 @@ class UnstartedCallDestination
// and started.
// Must be called from the party owned by the call, eg the following must
// hold:
// GPR_ASSERT(GetContext<Activity>() == unstarted_call_handler.party());
// CHECK(GetContext<Activity>() == unstarted_call_handler.party());
virtual void StartCall(UnstartedCallHandler unstarted_call_handler) = 0;
};

Expand Down