From 47103d5b17baa41949558285f026681f8bb4c530 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Thu, 24 Nov 2011 04:57:59 -0700 Subject: [PATCH] Bug 3366: assertion comm.cc:1276: isOpen(fd) via CompositePoolNode::kickReads Check Deferred read FD is still active before re-scheduling the read. --- src/comm.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/comm.cc b/src/comm.cc index 7fb20fed7a..4a45eb0400 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -2047,6 +2047,19 @@ DeferredReadManager::popHead(CbDataListContainer &deferredReads) assert (!deferredReads.empty()); DeferredRead &read = deferredReads.head->element; + + // NOTE: at this point the connection has been paused/stalled for an unknown + // amount of time. We must re-validate that it is active and usable. + + // If the connection has been closed already. Cancel this read. + if (!Comm::IsConnOpen(read.theRead.conn)) { + if (read.closer != NULL) { + read.closer->cancel("Connection closed before."); + read.closer = NULL; + } + read.markCancelled(); + } + if (!read.cancelled) { comm_remove_close_handler(read.theRead.conn->fd, read.closer); read.closer = NULL; -- 2.47.2