Nicola Ranaldo wrote:
I think master would check exit value of its childs and decrement the number
of ready_workers.
It seems like you perfectly right. I wrote a quick fix (i will be very thankful if you check my fix and correct me if I am wrong) and it works :-) Attachment contain this fix.
*** master.c.orig       Fri Nov  1 19:44:33 2002
--- master.c    Fri Dec  6 13:43:22 2002
***************
*** 720,728 ****
        if (c && c->pid == pid) {
            /* first thing in the linked list */
  
            /* decrement active count for service */
            if (c->s) c->s->nactive--;
! 
            ctable[pid % child_table_size] = c->next;
            c->next = cfreelist;
            cfreelist = c;
--- 720,733 ----
        if (c && c->pid == pid) {
            /* first thing in the linked list */
  
+           /* decrement workers count if process not exited correctly */
+           if (!(WIFEXITED(status)) && c->s) {
+               c->s->ready_workers--;
+           }
+ 
            /* decrement active count for service */
            if (c->s) c->s->nactive--;
!           
            ctable[pid % child_table_size] = c->next;
            c->next = cfreelist;
            cfreelist = c;
***************
*** 737,742 ****
--- 742,753 ----
                struct centry *t;
  
                t = c->next;
+ 
+               /* decrement workers count if process not exited correctly */
+               if (!(WIFEXITED(status)) && t->s) {
+                   t->s->ready_workers--;
+               }
+ 
                /* decrement active count for service */
                if (t->s) t->s->nactive--;
  


Reply via email to