[distcc] Re: dcc_check_backoff

Martin Pool mbp at samba.org
Mon Mar 1 04:52:11 GMT 2004


On 20 Jan 2004, Mark DeGeorge <mdegeorge at sammystudios.com> wrote:
> Ok, this is the end of the server log.  It does start complaining about
> having "Too Many Cleanups".  How can this be fixed?

Do you perhaps have DISTCC_SAVE_TEMPS=1 set?  Could you try this patch
and report the results please?

--- cleanup.c.~1.1.~	2003-07-24 18:41:04.000000000 +1000
+++ cleanup.c	2004-03-01 15:50:38.000000000 +1100
@@ -2,7 +2,7 @@
  * 
  * distcc -- A simple distributed compiler system
  *
- * Copyright (C) 2002, 2003 by Martin Pool <mbp at samba.org>
+ * Copyright (C) 2002, 2003, 2004 by Martin Pool <mbp at samba.org>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -54,27 +54,32 @@ volatile char *cleanups[N_CLEANUPS];
 
 
 
-/**
+/*
  * You can call this at any time, or hook it into atexit().  It is
  * safe to call repeatedly.
  *
  * If $DISTCC_SAVE_TEMPS is set to "1", then files are not actually
- * deleted, which can be good for debugging.
- **/
+ * deleted, which can be good for debugging.  However, we still need
+ * to remove them from the list, otherwise it will eventually overflow
+ * in prefork mode.
+ */
 void dcc_cleanup_tempfiles(void)
 {
     int i;
     int done = 0;
+    int save = dcc_getenv_bool("DISTCC_SAVE_TEMPS", 0);
 
-    if (dcc_getenv_bool("DISTCC_SAVE_TEMPS", 0)) /* tempus fugit */
-        return;
-
+     /* tempus fugit */
     for (i = 0; i < N_CLEANUPS && cleanups[i]; i++) {
-        if (unlink((char *) cleanups[i]) == -1 && (errno != ENOENT)) {
-            rs_log_notice("cleanup %s failed: %s", cleanups[i],
-                          strerror(errno));
+        if (save) {
+            rs_trace("skip cleanup of %s", cleanups[i]);
+        } else { 
+            if (unlink((char *) cleanups[i]) == -1 && (errno != ENOENT)) {
+                rs_log_notice("cleanup %s failed: %s", cleanups[i],
+                              strerror(errno));
+            }
+            done++;
         }
-        done++;
         free((char *) cleanups[i]);
         cleanups[i] = NULL;
     }


-- 
Martin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/distcc/attachments/20040301/8c9009e5/attachment.bin


More information about the distcc mailing list