[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

thinko in ipropd-master?



ipropd-master has an annoying tendency to spin, sucking all available CPU 
time.  It does not propagate changes to slaves when this happens.

select() is returning 1 with listen_fd set in readset, but the code for 
listen_fd is never invoked because the slave fd check unconditionally 
decrements ret for each slave (instead of only doing so when that slave's 
fd  is active).

Untested (as yet; about to recompile now) but logical fix:

--- lib/kadm5/ipropd_master.c.dist	Wed Jan 17 18:48:04 2001
+++ lib/kadm5/ipropd_master.c	Wed Jan 17 18:48:59 2001
@@ -472,8 +472,9 @@
 		send_diffs (context, p, log_fd, database, current_version);
 	}

-	for(p = slaves; p != NULL && ret--; p = p->next)
+	for(p = slaves; p != NULL; p = p->next)
 	    if (FD_ISSET(p->fd, &readset)) {
+		ret--;
 		if(process_msg (context, p, log_fd, database, current_version))
 		    remove_slave (context, p, &slaves);
 	    }


-- 
brandon s. allbery     [os/2][linux][solaris][japh]   allbery@kf8nh.apk.net
system administrator        [WAY too many hats]         allbery@ece.cmu.edu
electrical and computer engineering                                   KF8NH
carnegie mellon university     ["better check the oblivious first" -ke6sls]