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

Sync c-core 1.65.5 #276

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 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.65.4'
version = '1.65.5'
s.version = version
s.summary = 'gRPC C++ library'
s.homepage = 'https://grpc.io'
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.65.4'
version = '1.65.5'
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.65.4'
version = '1.65.5'
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.65.4'
version = '1.65.5'
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.65.4'
version = '1.65.5'
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/version_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

#define GRPC_CPP_VERSION_MAJOR 1
#define GRPC_CPP_VERSION_MINOR 65
#define GRPC_CPP_VERSION_PATCH 4
#define GRPC_CPP_VERSION_PATCH 5
#define GRPC_CPP_VERSION_TAG ""
#define GRPC_CPP_VERSION_STRING "1.65.4"
#define GRPC_CPP_VERSION_STRING "1.65.5"

#endif // GRPCPP_VERSION_INFO_H
18 changes: 15 additions & 3 deletions src/core/handshaker/security/secure_endpoint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ struct secure_endpoint {
}

~secure_endpoint() {
memory_owner.Reset();
tsi_frame_protector_destroy(protector);
tsi_zero_copy_grpc_protector_destroy(zero_copy_protector);
grpc_slice_buffer_destroy(&source_buffer);
Expand Down Expand Up @@ -255,6 +254,13 @@ static void on_read(void* user_data, grpc_error_handle error) {

{
grpc_core::MutexLock l(&ep->read_mu);

// If we were shut down after this callback was scheduled with OK
// status but before it was invoked, we need to treat that as an error.
if (ep->wrapped_ep == nullptr && error.ok()) {
error = absl::CancelledError("secure endpoint shutdown");
}

uint8_t* cur = GRPC_SLICE_START_PTR(ep->read_staging_buffer);
uint8_t* end = GRPC_SLICE_END_PTR(ep->read_staging_buffer);

Expand Down Expand Up @@ -382,9 +388,12 @@ static void flush_write_staging_buffer(secure_endpoint* ep, uint8_t** cur,

static void on_write(void* user_data, grpc_error_handle error) {
secure_endpoint* ep = static_cast<secure_endpoint*>(user_data);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, std::exchange(ep->write_cb, nullptr),
std::move(error));
grpc_closure* cb = ep->write_cb;
ep->write_cb = nullptr;
SECURE_ENDPOINT_UNREF(ep, "write");
grpc_core::EnsureRunInExecCtx([cb, error = std::move(error)]() {
grpc_core::Closure::Run(DEBUG_LOCATION, cb, error);
});
}

static void endpoint_write(grpc_endpoint* secure_ep, grpc_slice_buffer* slices,
Expand Down Expand Up @@ -506,7 +515,10 @@ static void endpoint_write(grpc_endpoint* secure_ep, grpc_slice_buffer* slices,

static void endpoint_destroy(grpc_endpoint* secure_ep) {
secure_endpoint* ep = reinterpret_cast<secure_endpoint*>(secure_ep);
ep->read_mu.Lock();
grpc_endpoint_destroy(ep->wrapped_ep);
ep->memory_owner.Reset();
ep->read_mu.Unlock();
SECURE_ENDPOINT_UNREF(ep, "destroy");
}

Expand Down
7 changes: 7 additions & 0 deletions src/core/lib/surface/call.cc
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,13 @@ void grpc_call_tracer_set(grpc_call* call,
return arena->SetContext<grpc_core::CallTracerAnnotationInterface>(tracer);
}

void grpc_call_tracer_set_and_manage(grpc_call* call,
grpc_core::ClientCallTracer* tracer) {
grpc_core::Arena* arena = grpc_call_get_arena(call);
arena->ManagedNew<ClientCallTracerWrapper>(tracer);
return arena->SetContext<grpc_core::CallTracerAnnotationInterface>(tracer);
}

void* grpc_call_tracer_get(grpc_call* call) {
grpc_core::Arena* arena = grpc_call_get_arena(call);
auto* call_tracer =
Expand Down
19 changes: 19 additions & 0 deletions src/core/lib/surface/call.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,16 @@ void grpc_call_log_batch(const char* file, int line, gpr_log_severity severity,

void grpc_call_tracer_set(grpc_call* call, grpc_core::ClientCallTracer* tracer);

// Sets call tracer on the call and manages its life by using the call's arena.
// When using this API, the tracer will be destroyed by grpc_call arena when
// grpc_call is about to be destroyed. The caller of this API SHOULD NOT
// manually destroy the tracer. This API is used by Python as a way of using
// Arena to manage the lifetime of the call tracer. Python needs this API
// because the tracer was created within a separate shared object library which
// doesn't have access to core functions like arena->ManagedNew<>.
void grpc_call_tracer_set_and_manage(grpc_call* call,
grpc_core::ClientCallTracer* tracer);

void* grpc_call_tracer_get(grpc_call* call);

#define GRPC_CALL_LOG_BATCH(sev, ops, nops) \
Expand All @@ -285,6 +295,15 @@ void* grpc_call_tracer_get(grpc_call* call);

uint8_t grpc_call_is_client(grpc_call* call);

class ClientCallTracerWrapper {
public:
explicit ClientCallTracerWrapper(grpc_core::ClientCallTracer* tracer)
: tracer_(tracer) {}

private:
std::unique_ptr<grpc_core::ClientCallTracer> tracer_;
};

// Return an appropriate compression algorithm for the requested compression \a
// level in the context of \a call.
grpc_compression_algorithm grpc_call_compression_for_level(
Expand Down
Loading
Loading