Skip to content

Commit 1fc0f4b

Browse files
authored
ratelimit: link legacy proto when message is being used (#4308)
Signed-off-by: Jose Nino jnino@lyft.com Description: the legacy ratelimit message is selectively used, so it is not linked by default. Previous to #4233 we had forced linking. In #4233 linking was forced while running tests, but --understandably so -- not in production code. This means that when this path is executed on a compiled binary, we would get a segfault due to a failure to resolved the service_method_ here. Risk Level: medium, fixes a crash Testing: Fixed the concrete repro showing the invalid reference on gdb, turn into a valid reference.
1 parent aa4481e commit 1fc0f4b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

source/common/ratelimit/ratelimit_impl.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ GrpcFactoryImpl::GrpcFactoryImpl(const envoy::config::ratelimit::v2::RateLimitSe
103103

104104
// TODO(junr03): legacy rate limit is deprecated. Remove this warning after 1.8.0.
105105
if (!use_data_plane_proto_) {
106+
// Force link time dependency on deprecated message type.
107+
pb::lyft::ratelimit::RateLimit _ignore;
106108
ENVOY_LOG_MISC(warn, "legacy rate limit client is deprecated, update your service to support "
107109
"the data-plane-api defined rate limit service");
108110
}

0 commit comments

Comments
 (0)