Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 Fluke 1/4/84; site fluke.UUCP
Path: utzoo!watmath!clyde!floyd!vax135!cornell!uw-beaver!ssc-vax!fluke!joe
From: joe@fluke.UUCP (Joe Kelsey)
Newsgroups: net.bugs.uucp
Subject: Re: Bug in 4.2 UUXQT
Message-ID: <1422@vax4.fluke.UUCP>
Date: Wed, 29-Feb-84 17:30:55 EST
Article-I.D.: vax4.1422
Posted: Wed Feb 29 17:30:55 1984
Date-Received: Sat, 3-Mar-84 07:35:12 EST
References: <1714@tektronix.UUCP> <1552@rlgvax.UUCP>, <1397@vax4.fluke.UUCP>, <80@down.UUCP>
Organization: John Fluke Mfg. Co., Everett, WA
Lines: 107

It seems that I was a little too trusting of Tom Truscott's original mock C
code to deal with dead work files stopping uuxqt.  In the fix I distributed,
uuxqt could still hang for upwards of several days if the first work file it
finds doesn't "gotfiles", since the modification won't remove it for a day.
I find that by moving the second call to "iswrk" to after the while loop
which removes dead work files, and putting a conditional return there, uuxqt
seems to work much better.  Here is the complete diff for uuxqt from the
distributed version.  One thing to think about is what Peter Honeyman
mentioned, whether the removing of dead files really belongs in uuxqt.  I
suppose if you really don't want to remove the dead file, you could just
comment out the unlink in the while loop, but you probably want to log a
message to make sure someone eventually notices this problem.  I think if
you don't unlink the files, uuxqt could still stall whenever you have a lot
of dead work files.  Anyway, here is the new diff:

*** /tmp/,RCSt1006994	Wed Feb 29 14:08:59 1984
--- uuxqt.c	Wed Feb 29 14:08:12 1984
***************
*** 25,30
  #define	NCMDS	50
  char *Cmds[NCMDS];
  
  int notiok = 1;
  int nonzero = 0;
  

--- 25,33 -----
  #define	NCMDS	50
  char *Cmds[NCMDS];
  
+ /* Nfiles is set in anlwrk.c. fluke!joe */
+ extern int Nfiles;
+ 
  int notiok = 1;
  int nonzero = 0;
  
***************
*** 304,309
   * Mod to recheck for X-able files. Sept 1982, rti!trt.
   * Suggested by utzoo.2458 (utzoo!henry)
   * Uses iswrk/gtwrkf to keep files in sequence, May 1983.
   */
  
  gtxfile(file)

--- 307,313 -----
   * Mod to recheck for X-able files. Sept 1982, rti!trt.
   * Suggested by utzoo.2458 (utzoo!henry)
   * Uses iswrk/gtwrkf to keep files in sequence, May 1983.
+  * Mod to check for old X. files, Feb. 1984, fluke!joe.
   */
  
  gtxfile(file)
***************
*** 311,316
  {
  	char pre[3];
  	register int rechecked;
  
  	pre[0] = XQTPRE;
  	pre[1] = '.';

--- 315,323 -----
  {
  	char pre[3];
  	register int rechecked;
+ 	time_t ystrdy;		/* yesterday */
+ 	extern time_t time();
+ 	struct stat stbuf;	/* for X file age */
  
  	pre[0] = XQTPRE;
  	pre[1] = '.';
***************
*** 333,338
  #endif
  	if (gotfiles(file))
  		return(1);
  	goto retry;
  }
  

--- 340,362 -----
  #endif
  	if (gotfiles(file))
  		return(1);
+ 	/* check for old X. file with no work files and remove them. */
+ 	/* suggested by Tom Truscott. fluke!joe */
+ 	if (Nfiles > LLEN/2) {
+ 	    time(&ystrdy);
+ 	    ystrdy -= (24 * 3600);		/* yesterday */
+ 	    DEBUG(4, "gtxfile: Nfiles > LLEN/2\n", "");
+ 	    while (gtwrkf(Spool, file) && !gotfiles(file)) {
+ 		if (stat(subfile(file), &stbuf) == 0)
+ 		    if (stbuf.st_mtime <= ystrdy) {
+ 			DEBUG(4, "gtxfile: unlink %s \n", file);
+ 			unlink(subfile(file));
+ 		    }
+ 	    }
+ 	    DEBUG(4, "iswrk\n", "");
+ 	    if (!iswrk(file, "get", Spool, pre))
+ 		return 0;
+ 	}
  	goto retry;
  }
  
Has anyone else installed this?  Or am I the only one brave enough?

/Joe