ezelkow1 commented on code in PR #12998:
URL: https://github.com/apache/trafficserver/pull/12998#discussion_r2962688650
##########
src/iocore/net/SSLUtils.cc:
##########
@@ -1528,11 +1529,20 @@ SSLMultiCertConfigLoader::_store_ssl_ctx(SSLCertLookup
*lookup, const shared_SSL
SSLMultiCertConfigLoader::CertLoadData data;
if (!this->_prep_ssl_ctx(sslMultCertSettings, data, common_names,
unique_names)) {
- lookup->is_valid = false;
+ {
+ std::lock_guard<std::mutex> lock(_loader_mutex);
+ lookup->is_valid = false;
+ }
return false;
}
std::vector<SSLLoadingContext> ctxs = this->init_server_ssl_ctx(data,
sslMultCertSettings.get());
+
+ // Serialize all mutations to the shared SSLCertLookup.
+ // The expensive work above (_prep_ssl_ctx + init_server_ssl_ctx) runs
+ // without the lock, allowing parallel cert loading across threads.
+ std::lock_guard<std::mutex> lock(_loader_mutex);
+
Review Comment:
The unique_names is a special corner case and so was left out intentionally
since it would require more complicated code changes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]