From: Christos Tsantilas Date: Mon, 3 Oct 2011 10:17:42 +0000 (+0300) Subject: Bug 3346: forward.cc:364: "entry->store_status == STORE_PENDING" X-Git-Tag: BumpSslServerFirst.take01~129 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c4a88a3e73000defeddf2ffd1a1104de08cb7fe6;p=thirdparty%2Fsquid.git Bug 3346: forward.cc:364: "entry->store_status == STORE_PENDING" While the server writes the response to Store, the client side may synchronously abort the entry. This happens, for example, when the server receives a 304 response and handleIMSReply calls sendClientOldEntry, which calls storeUnregister with our entry, resulting in CheckQuickAbort. Once server store write returns, if the server is done, it calls FwdState::completed(). At that time, the server does not know that (and should not care whether) the entry was aborted. Thus, we need to handle aborted entries in FwdState::completed. This is a Measurement Factory project. --- diff --git a/src/forward.cc b/src/forward.cc index cbada6fa16..cb52ffa612 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -146,6 +146,11 @@ FwdState::completed() flags.forward_completed = 1; + if (EBIT_TEST(entry->flags, ENTRY_ABORTED)) { + debugs(17, 3, HERE << "entry aborted"); + return ; + } + #if URL_CHECKSUM_DEBUG entry->mem_obj->checkUrlChecksum(); @@ -361,7 +366,6 @@ FwdState::unregister(int fd) void FwdState::complete() { - assert(entry->store_status == STORE_PENDING); debugs(17, 3, HERE << entry->url() << "\n\tstatus " << entry->getReply()->sline.status ); #if URL_CHECKSUM_DEBUG @@ -1017,6 +1021,12 @@ FwdState::reforward() { StoreEntry *e = entry; http_status s; + + if (EBIT_TEST(e->flags, ENTRY_ABORTED)) { + debugs(17, 3, HERE << "entry aborted"); + return 0; + } + assert(e->store_status == STORE_PENDING); assert(e->mem_obj); #if URL_CHECKSUM_DEBUG