You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2021/02/12 15:28:05 UTC

[trafficserver] branch 9.0.x updated: CacheRead: clear dir entry if doc is found to be truncated (#7064)

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 253e488  CacheRead: clear dir entry if doc is found to be truncated (#7064)
253e488 is described below

commit 253e488e6c2e4bb05b1019a7683bfe3dd1e53e57
Author: Brian Olsen <bn...@gmail.com>
AuthorDate: Fri Jan 29 06:17:40 2021 -0700

    CacheRead: clear dir entry if doc is found to be truncated (#7064)
    
    (cherry picked from commit dd71b9d9fefa5a5de7a6dc68eb3f6b13ff341afa)
---
 iocore/cache/CacheRead.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/iocore/cache/CacheRead.cc b/iocore/cache/CacheRead.cc
index 6c89987..7cf8064 100644
--- a/iocore/cache/CacheRead.cc
+++ b/iocore/cache/CacheRead.cc
@@ -563,7 +563,6 @@ CacheVC::openReadReadDone(int event, Event *e)
       VC_SCHED_LOCK_RETRY();
     }
     if (event == AIO_EVENT_DONE && !io.ok()) {
-      dir_delete(&earliest_key, vol, &earliest_dir);
       goto Lerror;
     }
     if (last_collision &&     // no missed lock
@@ -621,10 +620,11 @@ Lerror : {
   if (request.valid()) {
     int url_length;
     const char *url_text = request.url_get()->string_get_ref(&url_length);
-    Warning("Document %s truncated, url[%.*s]", earliest_key.toHexStr(tmpstring), url_length, url_text);
+    Warning("Document %s truncated, url[%.*s] .. clearing", earliest_key.toHexStr(tmpstring), url_length, url_text);
   } else {
-    Warning("Document %s truncated", earliest_key.toHexStr(tmpstring));
+    Warning("Document %s truncated .. clearing", earliest_key.toHexStr(tmpstring));
   }
+  dir_delete(&earliest_key, vol, &earliest_dir);
   return calluser(VC_EVENT_ERROR);
 }
 Ldone: