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.
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;