From 494f5ceda3847be65df39f035abbf0b929a5896d Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Sat, 18 May 2013 21:37:02 -0600 Subject: [PATCH] Avoid !closing assertions when helpers call comm_read [during reconfigure]. While helper reading code does check for COMM_ERR_CLOSING, it is not sufficient because helperReturnBuffer() called by the reading code may notice the helper shutdown flag (set earlier by reconfigure) and start closing the connection underneath the reading code feet. --- src/helper.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/helper.cc b/src/helper.cc index 0f3e0415b3..26172da47d 100644 --- a/src/helper.cc +++ b/src/helper.cc @@ -38,6 +38,7 @@ #include "comm/Connection.h" #include "comm/Write.h" #include "helper.h" +#include "fde.h" #include "format/Quoting.h" #include "MemBuf.h" #include "SquidMath.h" @@ -920,7 +921,7 @@ helperHandleRead(const Comm::ConnectionPointer &conn, char *buf, size_t len, com helperReturnBuffer(i, srv, hlp, msg, t); } - if (Comm::IsConnOpen(srv->readPipe)) { + if (Comm::IsConnOpen(srv->readPipe) && !fd_table[srv->readPipe->fd].closing()) { int spaceSize = srv->rbuf_sz - srv->roffset - 1; assert(spaceSize >= 0); @@ -1021,7 +1022,7 @@ helperStatefulHandleRead(const Comm::ConnectionPointer &conn, char *buf, size_t helperStatefulReleaseServer(srv); } - if (Comm::IsConnOpen(srv->readPipe)) { + if (Comm::IsConnOpen(srv->readPipe) && !fd_table[srv->readPipe->fd].closing()) { int spaceSize = srv->rbuf_sz - srv->roffset - 1; assert(spaceSize >= 0); -- 2.47.2