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

cmcfarlen pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit e2f12416ffce9ca52fa0dc70b511b4b9b7b65d6d
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]>
    (cherry picked from commit bf1ef914d8971b294ba09dac544ebfb417605490)
---
 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 9826b0854d..7964917217 100644
--- a/src/iocore/cache/CacheRead.cc
+++ b/src/iocore/cache/CacheRead.cc
@@ -821,12 +821,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;
@@ -901,7 +901,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 9c362fc2d0..6d31d4610c 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