]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
DW:
authorwessels <>
Fri, 12 May 2000 09:32:24 +0000 (09:32 +0000)
committerwessels <>
Fri, 12 May 2000 09:32:24 +0000 (09:32 +0000)
 - 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.

src/fs/diskd/store_dir_diskd.cc
src/fs/diskd/store_diskd.h
src/fs/diskd/store_io_diskd.cc

index cc4545d41b3a6a38218cb94fbfc440f575264efd..5c7f67abf48e2a8ebeec0e4a1c2a241571145a04 100644 (file)
@@ -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;
index 56f47e71ea3bb4a622ca783a9c16fdac1bcf4f4e..0ee2d89149dfb20159a1152fbd20d8a94cce951b 100644 (file)
@@ -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 *);
 
 
 /*
index 6141b0fd8f059b66af9a991bd45797589509ea14..0207de13a4bde0027d5926be6df8ac2546cb26a9 100644 (file)
@@ -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;
 }