ezelkow1 commented on code in PR #12852:
URL: https://github.com/apache/trafficserver/pull/12852#discussion_r2766513112


##########
src/proxy/http/HttpTransact.cc:
##########
@@ -3270,21 +3363,55 @@ HttpTransact::HandleCacheOpenReadMiss(State *s)
     s->cache_info.action = CacheAction_t::NO_ACTION;
   } else if (s->api_server_response_no_store) { // plugin may have decided not 
to cache the response
     s->cache_info.action = CacheAction_t::NO_ACTION;
-  } else if (s->cache_info.write_lock_state == CacheWriteLock_t::READ_RETRY) {
+  } else if (s->cache_info.write_lock_state == CacheWriteLock_t::READ_RETRY && 
!s->serving_stale_due_to_write_lock) {
     // We've looped back around due to failing to read during READ_RETRY mode.
     // Don't attempt another cache write - just proxy to origin without 
caching.
     TxnDbg(dbg_ctl_http_trans, "READ_RETRY cache read failed, bypassing 
cache");
     s->cache_info.action = CacheAction_t::NO_ACTION;
+  } else if (s->cache_info.write_lock_state == CacheWriteLock_t::READ_RETRY) {
+    // READ_RETRY with serving_stale_due_to_write_lock = true means we found 
stale content
+    // but can't serve it (e.g., MUST_PROXY auth). Hook already fired, just go 
to origin.
+    TxnDbg(dbg_ctl_http_trans, "READ_RETRY stale found but requires origin, 
bypassing cache");

Review Comment:
   added



-- 
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]

Reply via email to