Skip to content

Commit

Permalink
Sync c-core 1.64.3
Browse files Browse the repository at this point in the history
  • Loading branch information
HannahShiSFB committed Aug 4, 2024
1 parent df1ceba commit be54f5d
Show file tree
Hide file tree
Showing 31 changed files with 255 additions and 234 deletions.
4 changes: 3 additions & 1 deletion gRPC-C++.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-C++'
# TODO (mxyan): use version that match gRPC version when pod is stabilized
version = '1.64.2'
version = '1.64.3'
s.version = version
s.summary = 'gRPC C++ library'
s.homepage = 'https://grpc.io'
Expand Down Expand Up @@ -243,6 +243,8 @@ Pod::Spec.new do |s|
ss.dependency 'abseil/functional/bind_front', abseil_version
ss.dependency 'abseil/functional/function_ref', abseil_version
ss.dependency 'abseil/hash/hash', abseil_version
ss.dependency 'abseil/log/absl_check', abseil_version
ss.dependency 'abseil/log/absl_log', abseil_version
ss.dependency 'abseil/log/check', abseil_version
ss.dependency 'abseil/log/globals', abseil_version
ss.dependency 'abseil/log/log', abseil_version
Expand Down
2 changes: 1 addition & 1 deletion gRPC-Core.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC-Core'
version = '1.64.2'
version = '1.64.3'
s.version = version
s.summary = 'Core cross-platform gRPC library, written in C'
s.homepage = 'https://grpc.io'
Expand Down
2 changes: 1 addition & 1 deletion gRPC-ProtoRPC.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC-ProtoRPC'
version = '1.64.2'
version = '1.64.3'
s.version = version
s.summary = 'RPC library for Protocol Buffers, based on gRPC'
s.homepage = 'https://grpc.io'
Expand Down
2 changes: 1 addition & 1 deletion gRPC-RxLibrary.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC-RxLibrary'
version = '1.64.2'
version = '1.64.3'
s.version = version
s.summary = 'Reactive Extensions library for iOS/OSX.'
s.homepage = 'https://grpc.io'
Expand Down
2 changes: 1 addition & 1 deletion gRPC.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC'
version = '1.64.2'
version = '1.64.3'
s.version = version
s.summary = 'gRPC client library for iOS/OSX'
s.homepage = 'https://grpc.io'
Expand Down
4 changes: 2 additions & 2 deletions include/grpcpp/client_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <memory>
#include <string>

#include "absl/log/check.h"
#include "absl/log/absl_check.h"

#include <grpc/impl/compression_types.h>
#include <grpc/impl/propagation_bits.h>
Expand Down Expand Up @@ -248,7 +248,7 @@ class ClientContext {
/// \return A multimap of initial metadata key-value pairs from the server.
const std::multimap<grpc::string_ref, grpc::string_ref>&
GetServerInitialMetadata() const {
CHECK(initial_metadata_received_);
ABSL_CHECK(initial_metadata_received_);
return *recv_initial_metadata_.map();
}

Expand Down
8 changes: 4 additions & 4 deletions include/grpcpp/completion_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#include <list>

#include "absl/log/check.h"
#include "absl/log/absl_check.h"

#include <grpc/grpc.h>
#include <grpc/support/atm.h>
Expand Down Expand Up @@ -325,7 +325,7 @@ class CompletionQueue : private grpc::internal::GrpcLibrary {
bool ok = ev.success != 0;
void* ignored = tag;
if (tag->FinalizeResult(&ignored, &ok)) {
CHECK(ignored == tag);
ABSL_CHECK(ignored == tag);
return ok;
}
}
Expand All @@ -346,7 +346,7 @@ class CompletionQueue : private grpc::internal::GrpcLibrary {
bool ok = ev.success != 0;
void* ignored = tag;
// the tag must be swallowed if using TryPluck
CHECK(!tag->FinalizeResult(&ignored, &ok));
ABSL_CHECK(!tag->FinalizeResult(&ignored, &ok));
}

/// Performs a single polling pluck on \a tag. Calls tag->FinalizeResult if
Expand All @@ -363,7 +363,7 @@ class CompletionQueue : private grpc::internal::GrpcLibrary {

bool ok = ev.success != 0;
void* ignored = tag;
CHECK(!tag->FinalizeResult(&ignored, &ok));
ABSL_CHECK(!tag->FinalizeResult(&ignored, &ok));
}

/// Manage state of avalanching operations : completion queue tags that
Expand Down
17 changes: 9 additions & 8 deletions include/grpcpp/impl/call_op_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
#include <map>
#include <memory>

#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"

#include <grpc/grpc.h>
#include <grpc/impl/compression_types.h>
Expand Down Expand Up @@ -318,7 +319,7 @@ class CallOpSendMessage {
return;
}
if (msg_ != nullptr) {
CHECK(serializer_(msg_).ok());
ABSL_CHECK(serializer_(msg_).ok());
}
serializer_ = nullptr;
grpc_op* op = &ops[(*nops)++];
Expand Down Expand Up @@ -797,7 +798,7 @@ class CallOpClientRecvStatus {
if (recv_status_ == nullptr || hijacked_) return;
if (static_cast<StatusCode>(status_code_) == StatusCode::OK) {
*recv_status_ = Status();
DCHECK_EQ(debug_error_string_, nullptr);
ABSL_DCHECK_EQ(debug_error_string_, nullptr);
} else {
*recv_status_ =
Status(static_cast<StatusCode>(status_code_),
Expand Down Expand Up @@ -974,9 +975,9 @@ class CallOpSet : public CallOpSetInterface,
// A failure here indicates an API misuse; for example, doing a Write
// while another Write is already pending on the same RPC or invoking
// WritesDone multiple times
gpr_log(GPR_ERROR, "API misuse of type %s observed",
grpc_call_error_to_string(err));
CHECK(false);
ABSL_LOG(ERROR) << "API misuse of type " << grpc_call_error_to_string(err)
<< " observed";
ABSL_CHECK(false);
}
}

Expand All @@ -986,8 +987,8 @@ class CallOpSet : public CallOpSetInterface,
done_intercepting_ = true;
// The following call_start_batch is internally-generated so no need for an
// explanatory log on failure.
CHECK(grpc_call_start_batch(call_.call(), nullptr, 0, core_cq_tag(),
nullptr) == GRPC_CALL_OK);
ABSL_CHECK(grpc_call_start_batch(call_.call(), nullptr, 0, core_cq_tag(),
nullptr) == GRPC_CALL_OK);
}

private:
Expand Down
94 changes: 50 additions & 44 deletions include/grpcpp/impl/interceptor_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <array>
#include <functional>

#include "absl/log/check.h"
#include "absl/log/absl_check.h"

#include <grpc/impl/grpc_types.h>
#include <grpc/support/log.h>
Expand Down Expand Up @@ -58,15 +58,16 @@ class InterceptorBatchMethodsImpl
if (call_->client_rpc_info() != nullptr) {
return ProceedClient();
}
CHECK_NE(call_->server_rpc_info(), nullptr);
ABSL_CHECK_NE(call_->server_rpc_info(), nullptr);
ProceedServer();
}

void Hijack() override {
// Only the client can hijack when sending down initial metadata
CHECK(!reverse_ && ops_ != nullptr && call_->client_rpc_info() != nullptr);
ABSL_CHECK(!reverse_ && ops_ != nullptr &&
call_->client_rpc_info() != nullptr);
// It is illegal to call Hijack twice
CHECK(!ran_hijacking_interceptor_);
ABSL_CHECK(!ran_hijacking_interceptor_);
auto* rpc_info = call_->client_rpc_info();
rpc_info->hijacked_ = true;
rpc_info->hijacked_interceptor_ = current_interceptor_index_;
Expand All @@ -81,21 +82,21 @@ class InterceptorBatchMethodsImpl
}

ByteBuffer* GetSerializedSendMessage() override {
CHECK_NE(orig_send_message_, nullptr);
ABSL_CHECK_NE(orig_send_message_, nullptr);
if (*orig_send_message_ != nullptr) {
CHECK(serializer_(*orig_send_message_).ok());
ABSL_CHECK(serializer_(*orig_send_message_).ok());
*orig_send_message_ = nullptr;
}
return send_message_;
}

const void* GetSendMessage() override {
CHECK_NE(orig_send_message_, nullptr);
ABSL_CHECK_NE(orig_send_message_, nullptr);
return *orig_send_message_;
}

void ModifySendMessage(const void* message) override {
CHECK_NE(orig_send_message_, nullptr);
ABSL_CHECK_NE(orig_send_message_, nullptr);
*orig_send_message_ = message;
}

Expand Down Expand Up @@ -130,7 +131,7 @@ class InterceptorBatchMethodsImpl
Status* GetRecvStatus() override { return recv_status_; }

void FailHijackedSendMessage() override {
CHECK(hooks_[static_cast<size_t>(
ABSL_CHECK(hooks_[static_cast<size_t>(
experimental::InterceptionHookPoints::PRE_SEND_MESSAGE)]);
*fail_send_message_ = true;
}
Expand Down Expand Up @@ -193,7 +194,7 @@ class InterceptorBatchMethodsImpl
}

void FailHijackedRecvMessage() override {
CHECK(hooks_[static_cast<size_t>(
ABSL_CHECK(hooks_[static_cast<size_t>(
experimental::InterceptionHookPoints::PRE_RECV_MESSAGE)]);
*hijacked_recv_message_failed_ = true;
}
Expand Down Expand Up @@ -237,7 +238,7 @@ class InterceptorBatchMethodsImpl
// ContinueFinalizeOpsAfterInterception will be called. Note that neither of
// them is invoked if there were no interceptors registered.
bool RunInterceptors() {
CHECK(ops_);
ABSL_CHECK(ops_);
auto* client_rpc_info = call_->client_rpc_info();
if (client_rpc_info != nullptr) {
if (client_rpc_info->interceptors_.empty()) {
Expand All @@ -262,8 +263,8 @@ class InterceptorBatchMethodsImpl
// SyncRequest.
bool RunInterceptors(std::function<void(void)> f) {
// This is used only by the server for initial call request
CHECK_EQ(reverse_, true);
CHECK_EQ(call_->client_rpc_info(), nullptr);
ABSL_CHECK_EQ(reverse_, true);
ABSL_CHECK_EQ(call_->client_rpc_info(), nullptr);
auto* server_rpc_info = call_->server_rpc_info();
if (server_rpc_info == nullptr || server_rpc_info->interceptors_.empty()) {
return true;
Expand Down Expand Up @@ -357,7 +358,7 @@ class InterceptorBatchMethodsImpl
return ops_->ContinueFinalizeResultAfterInterception();
}
}
CHECK(callback_);
ABSL_CHECK(callback_);
callback_();
}

Expand Down Expand Up @@ -423,98 +424,103 @@ class CancelInterceptorBatchMethods

void Hijack() override {
// Only the client can hijack when sending down initial metadata
CHECK(false) << "It is illegal to call Hijack on a method which has a "
"Cancel notification";
ABSL_CHECK(false) << "It is illegal to call Hijack on a method which has a "
"Cancel notification";
}

ByteBuffer* GetSerializedSendMessage() override {
CHECK(false) << "It is illegal to call GetSendMessage on a method which "
"has a Cancel notification";
ABSL_CHECK(false)
<< "It is illegal to call GetSendMessage on a method which "
"has a Cancel notification";
return nullptr;
}

bool GetSendMessageStatus() override {
CHECK(false)
ABSL_CHECK(false)
<< "It is illegal to call GetSendMessageStatus on a method which "
"has a Cancel notification";
return false;
}

const void* GetSendMessage() override {
CHECK(false)
ABSL_CHECK(false)
<< "It is illegal to call GetOriginalSendMessage on a method which "
"has a Cancel notification";
return nullptr;
}

void ModifySendMessage(const void* /*message*/) override {
CHECK(false) << "It is illegal to call ModifySendMessage on a method which "
"has a Cancel notification";
ABSL_CHECK(false)
<< "It is illegal to call ModifySendMessage on a method which "
"has a Cancel notification";
}

std::multimap<std::string, std::string>* GetSendInitialMetadata() override {
CHECK(false) << "It is illegal to call GetSendInitialMetadata on a "
"method which has a Cancel notification";
ABSL_CHECK(false) << "It is illegal to call GetSendInitialMetadata on a "
"method which has a Cancel notification";
return nullptr;
}

Status GetSendStatus() override {
CHECK(false) << "It is illegal to call GetSendStatus on a method which "
"has a Cancel notification";
ABSL_CHECK(false)
<< "It is illegal to call GetSendStatus on a method which "
"has a Cancel notification";
return Status();
}

void ModifySendStatus(const Status& /*status*/) override {
CHECK(false) << "It is illegal to call ModifySendStatus on a method "
"which has a Cancel notification";
ABSL_CHECK(false) << "It is illegal to call ModifySendStatus on a method "
"which has a Cancel notification";
}

std::multimap<std::string, std::string>* GetSendTrailingMetadata() override {
CHECK(false) << "It is illegal to call GetSendTrailingMetadata on a "
"method which has a Cancel notification";
ABSL_CHECK(false) << "It is illegal to call GetSendTrailingMetadata on a "
"method which has a Cancel notification";
return nullptr;
}

void* GetRecvMessage() override {
CHECK(false) << "It is illegal to call GetRecvMessage on a method which "
"has a Cancel notification";
ABSL_CHECK(false)
<< "It is illegal to call GetRecvMessage on a method which "
"has a Cancel notification";
return nullptr;
}

std::multimap<grpc::string_ref, grpc::string_ref>* GetRecvInitialMetadata()
override {
CHECK(false) << "It is illegal to call GetRecvInitialMetadata on a "
"method which has a Cancel notification";
ABSL_CHECK(false) << "It is illegal to call GetRecvInitialMetadata on a "
"method which has a Cancel notification";
return nullptr;
}

Status* GetRecvStatus() override {
CHECK(false) << "It is illegal to call GetRecvStatus on a method which "
"has a Cancel notification";
ABSL_CHECK(false)
<< "It is illegal to call GetRecvStatus on a method which "
"has a Cancel notification";
return nullptr;
}

std::multimap<grpc::string_ref, grpc::string_ref>* GetRecvTrailingMetadata()
override {
CHECK(false) << "It is illegal to call GetRecvTrailingMetadata on a "
"method which has a Cancel notification";
ABSL_CHECK(false) << "It is illegal to call GetRecvTrailingMetadata on a "
"method which has a Cancel notification";
return nullptr;
}

std::unique_ptr<ChannelInterface> GetInterceptedChannel() override {
CHECK(false) << "It is illegal to call GetInterceptedChannel on a "
"method which has a Cancel notification";
ABSL_CHECK(false) << "It is illegal to call GetInterceptedChannel on a "
"method which has a Cancel notification";
return std::unique_ptr<ChannelInterface>(nullptr);
}

void FailHijackedRecvMessage() override {
CHECK(false) << "It is illegal to call FailHijackedRecvMessage on a "
"method which has a Cancel notification";
ABSL_CHECK(false) << "It is illegal to call FailHijackedRecvMessage on a "
"method which has a Cancel notification";
}

void FailHijackedSendMessage() override {
CHECK(false) << "It is illegal to call FailHijackedSendMessage on a "
"method which has a Cancel notification";
ABSL_CHECK(false) << "It is illegal to call FailHijackedSendMessage on a "
"method which has a Cancel notification";
}
};
} // namespace internal
Expand Down
Loading

0 comments on commit be54f5d

Please sign in to comment.