@@ -234,19 +234,20 @@ void ClusterManagerInitHelper::setPrimaryClustersInitializedCb(
234
234
ClusterManagerImpl::ClusterManagerImpl (
235
235
const envoy::config::bootstrap::v3::Bootstrap& bootstrap, ClusterManagerFactory& factory,
236
236
Stats::Store& stats, ThreadLocal::Instance& tls, Runtime::Loader& runtime,
237
- Random::RandomGenerator& random, const LocalInfo::LocalInfo& local_info ,
238
- AccessLog::AccessLogManager& log_manager, Event::Dispatcher& main_thread_dispatcher ,
239
- Server::Admin& admin, ProtobufMessage::ValidationContext& validation_context, Api::Api& api,
237
+ const LocalInfo::LocalInfo& local_info, AccessLog::AccessLogManager& log_manager ,
238
+ Event::Dispatcher& main_thread_dispatcher, Server::Admin& admin ,
239
+ ProtobufMessage::ValidationContext& validation_context, Api::Api& api,
240
240
Http::Context& http_context, Grpc::Context& grpc_context)
241
241
: factory_(factory), runtime_(runtime), stats_(stats), tls_(tls.allocateSlot()),
242
- random_ (random), bind_config_(bootstrap.cluster_manager().upstream_bind_config()),
243
- local_info_(local_info), cm_stats_(generateStats(stats)),
242
+ random_ (api.randomGenerator()),
243
+ bind_config_(bootstrap.cluster_manager().upstream_bind_config()), local_info_(local_info),
244
+ cm_stats_(generateStats(stats)),
244
245
init_helper_(*this , [this ](Cluster& cluster) { onClusterInit (cluster); }),
245
246
config_tracker_entry_ (
246
247
admin.getConfigTracker().add(" clusters" , [this ] { return dumpClusterConfigs (); })),
247
248
time_source_(main_thread_dispatcher.timeSource()), dispatcher_(main_thread_dispatcher),
248
249
http_context_(http_context),
249
- subscription_factory_(local_info, main_thread_dispatcher, *this , random,
250
+ subscription_factory_(local_info, main_thread_dispatcher, *this ,
250
251
validation_context.dynamicValidationVisitor(), api, runtime_) {
251
252
async_client_manager_ = std::make_unique<Grpc::AsyncClientManagerImpl>(
252
253
*this , tls, time_source_, api, grpc_context.statNames ());
@@ -1456,8 +1457,8 @@ ClusterManagerImpl::ThreadLocalClusterManagerImpl::ClusterEntry::tcpConnPool(
1456
1457
ClusterManagerPtr ProdClusterManagerFactory::clusterManagerFromProto (
1457
1458
const envoy::config::bootstrap::v3::Bootstrap& bootstrap) {
1458
1459
return ClusterManagerPtr{new ClusterManagerImpl (
1459
- bootstrap, *this , stats_, tls_, runtime_, random_, local_info_, log_manager_,
1460
- main_thread_dispatcher_, admin_, validation_context_, api_, http_context_, grpc_context_)};
1460
+ bootstrap, *this , stats_, tls_, runtime_, local_info_, log_manager_, main_thread_dispatcher_ ,
1461
+ admin_, validation_context_, api_, http_context_, grpc_context_)};
1461
1462
}
1462
1463
1463
1464
Http::ConnectionPool::InstancePtr ProdClusterManagerFactory::allocateConnPool (
@@ -1466,14 +1467,14 @@ Http::ConnectionPool::InstancePtr ProdClusterManagerFactory::allocateConnPool(
1466
1467
const Network::TransportSocketOptionsSharedPtr& transport_socket_options) {
1467
1468
if (protocol == Http::Protocol::Http2 &&
1468
1469
runtime_.snapshot ().featureEnabled (" upstream.use_http2" , 100 )) {
1469
- return Http::Http2::allocateConnPool (dispatcher, random_ , host, priority, options ,
1470
- transport_socket_options);
1470
+ return Http::Http2::allocateConnPool (dispatcher, api_. randomGenerator () , host, priority,
1471
+ options, transport_socket_options);
1471
1472
} else if (protocol == Http::Protocol::Http3) {
1472
1473
// Quic connection pool is not implemented.
1473
1474
NOT_IMPLEMENTED_GCOVR_EXCL_LINE;
1474
1475
} else {
1475
- return Http::Http1::allocateConnPool (dispatcher, random_ , host, priority, options ,
1476
- transport_socket_options);
1476
+ return Http::Http1::allocateConnPool (dispatcher, api_. randomGenerator () , host, priority,
1477
+ options, transport_socket_options);
1477
1478
}
1478
1479
}
1479
1480
@@ -1494,7 +1495,7 @@ std::pair<ClusterSharedPtr, ThreadAwareLoadBalancerPtr> ProdClusterManagerFactor
1494
1495
const envoy::config::cluster::v3::Cluster& cluster, ClusterManager& cm,
1495
1496
Outlier::EventLoggerSharedPtr outlier_event_logger, bool added_via_api) {
1496
1497
return ClusterFactoryImplBase::create (
1497
- cluster, cm, stats_, tls_, dns_resolver_, ssl_context_manager_, runtime_, random_,
1498
+ cluster, cm, stats_, tls_, dns_resolver_, ssl_context_manager_, runtime_,
1498
1499
main_thread_dispatcher_, log_manager_, local_info_, admin_, singleton_manager_,
1499
1500
outlier_event_logger, added_via_api,
1500
1501
added_via_api ? validation_context_.dynamicValidationVisitor ()
0 commit comments