From: wessels <> Date: Fri, 12 May 2000 09:32:24 +0000 (+0000) Subject: DW: X-Git-Tag: SQUID_3_0_PRE1~1978 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=429c5aa33ad08d4b04e85f457abee115a4e161d9;p=thirdparty%2Fsquid.git DW: - When diskd got MODIO'ified, this important bit got dropped for some reason. If we don't drain the queue sometimes in MsgSend, its quite possible to run out of shared memory buffers. Probably event more important, we don't want to have too many messages outstanding without processing some replies back from the diskd daemons. --- diff --git a/src/fs/diskd/store_dir_diskd.cc b/src/fs/diskd/store_dir_diskd.cc index cc4545d41b..5c7f67abf4 100644 --- a/src/fs/diskd/store_dir_diskd.cc +++ b/src/fs/diskd/store_dir_diskd.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_diskd.cc,v 1.2 2000/05/12 00:29:20 wessels Exp $ + * $Id: store_dir_diskd.cc,v 1.3 2000/05/12 03:32:24 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -135,7 +135,6 @@ static time_t storeDiskdDirExpiredReferenceAge(SwapDir *); #endif static void storeDiskdStats(StoreEntry * sentry); static void storeDiskdDirSync(SwapDir *); -static void storeDiskdDirCallback(SwapDir *); /* @@ -473,7 +472,7 @@ storeDiskdDirSync(SwapDir * SD) * until the queue is below magic2. Otherwise, we simply return when we * don't get a message. */ -static void +void storeDiskdDirCallback(SwapDir * SD) { diomsg M; diff --git a/src/fs/diskd/store_diskd.h b/src/fs/diskd/store_diskd.h index 56f47e71ea..0ee2d89149 100644 --- a/src/fs/diskd/store_diskd.h +++ b/src/fs/diskd/store_diskd.h @@ -93,6 +93,7 @@ extern void storeDiskdDirReplRemove(StoreEntry *); extern void storeDiskdShmPut(SwapDir *, int); extern void *storeDiskdShmGet(SwapDir *, int *); extern void storeDiskdHandle(diomsg * M); +extern void storeDiskdDirCallback(SwapDir *); /* diff --git a/src/fs/diskd/store_io_diskd.cc b/src/fs/diskd/store_io_diskd.cc index 6141b0fd8f..0207de13a4 100644 --- a/src/fs/diskd/store_io_diskd.cc +++ b/src/fs/diskd/store_io_diskd.cc @@ -445,6 +445,13 @@ storeDiskdSend(int mtype, SwapDir * sd, int id, storeIOState * sio, int size, in cbdataUnlock(M.callback_data); assert(++send_errors < 100); } + /* + * We have to drain the queue here if necessary. If we don't, + * then we can have a lot of messages in the queue (probably + * up to 2*magic1) and we can run out of shared memory buffers. + */ + if (diskdinfo->away > diskdinfo->magic2) + storeDiskdDirCallback(sd); return x; }