Skip to content

[Python] multiple grpc_init calls in grpcio (with GRPC_PYTHON_BUILD_SYSTEM_GRPC_CORE="True") #41672

@h-vetinari

Description

@h-vetinari

Note that I did see one thing across all platforms that stood out in the logs

import: 'grpc'
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
E0000 00:00:1768183333.443022    5476 instrument.cc:563] Metric with name 'grpc.resource_quota.calls_dropped' registered more than once. Ignoring later registration.
E0000 00:00:1768183333.444226    5476 instrument.cc:563] Metric with name 'grpc.resource_quota.calls_rejected' registered more than once. Ignoring later registration.
E0000 00:00:1768183333.444249    5476 instrument.cc:563] Metric with name 'grpc.resource_quota.connections_dropped' registered more than once. Ignoring later registration.
E0000 00:00:1768183333.444259    5476 instrument.cc:563] Metric with name 'grpc.resource_quota.instantaneous_memory_pressure' registered more than once. Ignoring later registration.
E0000 00:00:1768183333.444267    5476 instrument.cc:563] Metric with name 'grpc.resource_quota.memory_pressure_control_value' registered more than once. Ignoring later registration.

(this is not shortened; that's the whole of it.)

The presence of the warning could due to the fact that we're using newer abseil, but the content itself comes from grpc

if (!it.second) {
// If this is firing one of two things is true:
// 1. We have code in gRPC that's registering two different metrics with the
// same name. gRPC should fix this.
// 2. gRPC static initialization is executing twice. This is an unsupported
// use of the gRPC library and the application owner should fix it.
LOG(ERROR) << "Metric with name '" << name
<< "' registered more than once. Ignoring later registration.";
}

According to that comment "This is an unsupported use of the gRPC library and the application owner should fix it." Since it happens with grpc's own python bindings, I thought I'd let you know.

Originally posted by @h-vetinari in #40639

For context, in conda-forge, we're building grpcio against shared libraries of abseil/protobuf, and crucially, a pre-existing shared libgrpc with GRPC_PYTHON_BUILD_SYSTEM_GRPC_CORE="True" (built from the same commit though, so everything is consistent); as of conda-forge/grpc-cpp-feedstock#421, we're at libabseil 20260107 and libprotobuf 6.33.5

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions