masaori335 commented on code in PR #12794: URL: https://github.com/apache/trafficserver/pull/12794#discussion_r2726069506
########## src/iocore/cache/Cache.cc: ########## @@ -543,20 +565,24 @@ Cache::open_read(Continuation *cont, const CacheKey *key, CacheHTTPHdr *request, OpenDirEntry *od = nullptr; CacheVC *c = nullptr; + // Read-While-Writer + // This OpenDirEntry lookup doesn't need stripe mutex lock because OpenDir has own reader-writer lock + od = stripe->open_read(key); Review Comment: I checked this case. `CacheVC::openReadFromWriter` holds `stripe->mutex` and other operations also covered by `stripe->mutex`, so it's fine. Also, what Copilot concerned, the dead lock of two mutex(s), the order is always 1). lock `stripe->mutex` then 2). lock `_shared_mutex`, so there're no ordering issue for now. In the future, when we do refactoring with the `stripe->mutex`, we need to be careful, though. -- 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]
