c-taylor commented on code in PR #13098:
URL: https://github.com/apache/trafficserver/pull/13098#discussion_r3342414969
##########
src/iocore/net/SSLCertLookup.cc:
##########
@@ -249,7 +250,7 @@ SSLCertContext::operator=(SSLCertContext const &other)
this->userconfig = other.userconfig;
this->keyblock = other.keyblock;
this->ctx_type = other.ctx_type;
- std::lock_guard<std::mutex> lock(other.ctx_mutex);
+ std::shared_lock lock(other.ctx_mutex);
Review Comment:
This PR does not introduce or fix this hypothetical data race.
The suggested change above does not resolve fields [opt, userconfig,
keyblock, ctx_type] also subject to the same hypothetical.
> No new races introduced by the change.
> - Reader/reader: previously serialized, now parallel — safe (shared_ptr
concurrent-read).
> - Reader/writer (setCtx): excluded both before and after.
> - Writer/writer (setCtx/setCtx): excluded both before and after.
> - The operator=-vs-anything gap: identical race profile before and after.
>
> So the std::shared_mutex change is strictly a contention reduction. Any
race you can construct after the change, you could already construct before it.
claude also believes that the probability of hitting the pre-existing race
is reduced by this change.
I will resolve here and raise a separate issue for the hypothetical race.
--
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]