Wietse Venema:
> Ralf Hildebrandt:
> > What exactly would cause a "fatal: watchdog timeout" in pickup?
> > >From what I know this happens if a program takes just too long to
> > finish (command_time_limit?)
> > 
> > But what can cause pickup to take sooo long?
> > 
> > Jan 21 13:13:58 mrora01 postfix2/pickup[25256]: fatal: watchdog timeout
> > Jan 21 13:13:59 mrora01 postfix2/cleanup[22697]: warning: premature end-of-input on cleanup socket while reading input attribute name
> > Jan 21 13:13:59 mrora01 postfix2/master[2624]: warning: process /usr/libexec/postfix/pickup pid 25256 exit status 1
> > Jan 21 13:13:59 mrora01 postfix2/master[2624]: warning: /usr/libexec/postfix/pickup: bad command startup -- throttling
> 
> The pickup server copies mail from the maildrop queue to the cleanup
> server. If the pickup server is busy for too much time then the
> watchdog timer goes off.
> 
> Possibilities:
> 
> 1 - The cleanup server is bogged down with body checks. Not likely
>     in the above case
> 
> 2 - The maildrop directory is being filled so that the pickup server
>     never finishes. This is a Postfix bug that can be fixed by
>     stroking the watchdog so it does not bark, just like the SMTP
>     server does after every SMTP command. I will work on that later
>     because today I was supposed to read a ton of documents.

Patch follows.

	Wietse

*** postfix-2.0.18-20040122/src/pickup/pickup.c-	Sun Jan  4 12:35:18 2004
--- postfix-2.0.18-20040122/src/pickup/pickup.c	Thu Jan 22 19:23:39 2004
***************
*** 100,105 ****
--- 100,106 ----
  #include <vstream.h>
  #include <set_ugid.h>
  #include <safe_open.h>
+ #include <watchdog.h>
  
  /* Global library. */
  
***************
*** 456,461 ****
--- 457,466 ----
       * still being written, or garbage. Leave it up to the sysadmin to remove
       * garbage. Keep scanning the queue directory until we stop removing
       * files from it.
+      * 
+      * When we find a file, stroke the watchdog so that it will not bark while
+      * some application is keeping us busy by injecting lots of mail into the
+      * maildrop directory.
       */
      queue_name = MAIL_QUEUE_MAILDROP;		/* XXX should be a list */
      do {
***************
*** 465,470 ****
--- 470,476 ----
  	    if (mail_open_ok(queue_name, id, &info.st, &path) == MAIL_OPEN_YES) {
  		pickup_init(&info);
  		info.path = mystrdup(path);
+ 		watchdog_pat();
  		if (pickup_file(&info) == REMOVE_MESSAGE_FILE) {
  		    if (REMOVE(info.path))
  			msg_warn("remove %s: %m", info.path);
*** postfix-2.0.18-20040122/src/pickup/Makefile.in-	Fri Jan 16 14:57:07 2004
--- postfix-2.0.18-20040122/src/pickup/Makefile.in	Thu Jan 22 19:20:55 2004
***************
*** 61,66 ****
--- 61,67 ----
  pickup.o: ../../include/vstream.h
  pickup.o: ../../include/set_ugid.h
  pickup.o: ../../include/safe_open.h
+ pickup.o: ../../include/watchdog.h
  pickup.o: ../../include/mail_queue.h
  pickup.o: ../../include/mail_open_ok.h
  pickup.o: ../../include/mymalloc.h
