From: Amos Jeffries Date: Sun, 29 Aug 2010 00:52:30 +0000 (-0600) Subject: Author: Stefan Fritsch X-Git-Tag: SQUID_3_1_8~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=717943a01e2ffd466113f793d6eefe98b7b33114;p=thirdparty%2Fsquid.git Author: Stefan Fritsch Bug 2872: leaking file descriptors As I understand it, the leak happens this way: A client request kicks off an asynchronous file open request. If the client request is aborted and disappears before the file open has completed, the file is never closed again. This explains why this leak can only happen with aufs and not with ufs. --- diff --git a/src/fs/ufs/store_io_ufs.cc b/src/fs/ufs/store_io_ufs.cc index 035e6935fa..35d9c597a5 100644 --- a/src/fs/ufs/store_io_ufs.cc +++ b/src/fs/ufs/store_io_ufs.cc @@ -452,8 +452,14 @@ UFSStoreState::kickReadQueue() void *cbdata; - if (cbdataReferenceValidDone(q->callback_data, &cbdata)) + if (cbdataReferenceValidDone(q->callback_data, &cbdata)) { read_(q->buf, q->size, q->offset, q->callback, cbdata); + } + else { + debugs(79, 2, "UFSStoreState::kickReadQueue: this: " << this << " cbdataReferenceValidDone returned false." << " closing: " << closing << " flags.try_closing: " << flags.try_closing); + delete q; + return false; + } delete q;