[torqueusers] [PATCH] fix zombie pbs_iff processes

Garrick Staples garrick at usc.edu
Tue Nov 2 00:52:53 MST 2004


On Tue, Oct 26, 2004 at 12:05:10PM -0700, Garrick Staples alleged:
> Also, I've long suspected a bug in the client libs that fail to reap failed
> pbs_iff processes.  This is evident in longer running clients like 'qsub -I'
> and pbstop.  If one pbs_iff times out, it stays around as a zombie. 

I think I found this.  It wasn't calling pclose() when it didn't read the
correct value.   Also removed some unnecessary casts.


diff -ruN torque-1.1.0p4_orig/src/lib/Libifl/pbsD_connect.c torque-1.1.0p4/src/lib/Libifl/pbsD_connect.c
--- torque-1.1.0p4_orig/src/lib/Libifl/pbsD_connect.c	2004-10-28 15:50:48.000000000 -0700
+++ torque-1.1.0p4/src/lib/Libifl/pbsD_connect.c	2004-11-01 23:21:35.000000000 -0800
@@ -243,15 +243,16 @@
   (void)sprintf(cmd, "%s %s %u %d", IFF_PATH, server_name, server_port,
     psock);
 
-  piff = (FILE *)popen(cmd, "r");
+  piff = popen(cmd, "r");
 
-  if (piff == (FILE *)0)
+  if (piff == NULL)
     return(-1);
 
   i = read(fileno(piff),&cred_type,sizeof(int));
 
   if ((i != sizeof (int)) || (cred_type != PBS_credentialtype_none))
     {
+    j = pclose(piff);
     return(-1);
     }
 


-- 
Garrick Staples, Linux/HPCC Administrator
University of Southern California
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.supercluster.org/pipermail/torqueusers/attachments/20041101/51463ede/attachment.bin


More information about the torqueusers mailing list