This is an automated email from the ASF dual-hosted git repository.

lserris pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new bf1ef914d8 Decouple recursive var in CacheVC (#12771)
bf1ef914d8 is described below

commit bf1ef914d8971b294ba09dac544ebfb417605490
Author: Serris Santos <[email protected]>
AuthorDate: Fri Jan 2 09:19:17 2026 -0800

    Decouple recursive var in CacheVC (#12771)
    
    Co-authored-by: Serris Lew <[email protected]>
---
 src/iocore/cache/CacheRead.cc | 6 +++---
 src/iocore/cache/CacheVC.h    | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/iocore/cache/CacheRead.cc b/src/iocore/cache/CacheRead.cc
index c3c2e40aee..5bdba317ca 100644
--- a/src/iocore/cache/CacheRead.cc
+++ b/src/iocore/cache/CacheRead.cc
@@ -822,12 +822,12 @@ CacheVC::openReadStartEarliest(int /* event ATS_UNUSED 
*/, Event * /* e ATS_UNUS
       if ((call_result = do_read_call(&key)) == EVENT_RETURN) {
         if (this->handler == 
reinterpret_cast<ContinuationHandler>(&CacheVC::openReadStartEarliest)) {
           is_recursive_call = true;
-          if (recursive > MAX_READ_RECURSION_DEPTH) {
+          if (read_recursive > MAX_READ_RECURSION_DEPTH) {
             char tmpstring[CRYPTO_HEX_SIZE];
             Error("Too many recursive calls with %s", key.toHexStr(tmpstring));
             goto Ldone;
           }
-          ++recursive;
+          ++read_recursive;
         }
 
         goto Lcallreturn;
@@ -902,7 +902,7 @@ CacheVC::openReadStartEarliest(int /* event ATS_UNUSED */, 
Event * /* e ATS_UNUS
 Lcallreturn:
   event_result = handleEvent(AIO_EVENT_DONE, nullptr); // hopefully a tail call
   if (is_recursive_call) {
-    --recursive;
+    --read_recursive;
   }
   return event_result;
 Lsuccess:
diff --git a/src/iocore/cache/CacheVC.h b/src/iocore/cache/CacheVC.h
index cb75c34ba8..3ca74ce650 100644
--- a/src/iocore/cache/CacheVC.h
+++ b/src/iocore/cache/CacheVC.h
@@ -268,6 +268,7 @@ struct CacheVC : public CacheVConnection {
   ink_hrtime                start_time;
   int                       op_type; // Index into the metrics array for this 
operation, rather than a CacheOpType (fewer casts)
   int                       recursive;
+  int                       read_recursive;
   int                       closed;
   uint64_t                  seek_to;       // pread offset
   int64_t                   offset;        // offset into 'blocks' of data to 
write

Reply via email to