Update of /cvsroot/monetdb/MonetDB5/src/mal
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv3256

Modified Files:
        mal.mx 
Log Message:
Generate informative information on the status of 'hanging' client
threads.


Index: mal.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal.mx,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -d -r1.122 -r1.123
--- mal.mx      29 May 2007 19:40:24 -0000      1.122
+++ mal.mx      29 May 2007 21:51:37 -0000      1.123
@@ -374,30 +374,35 @@
 memory leakage problems later on.
 @c
 void mal_exit(void){
-       int t = 0, activeClients, reruns=0;
+       int t = 0, cnt[4], reruns=0;
        str err;
        Client cntxt = mal_clients;
 
+       cnt[FREECLIENT]=0;
+       cnt[FINISHING]=0;
+       cnt[CLAIMED]=0;
+       cnt[AWAITING]=0;
+
 @-
 Before continuing we should make sure that all clients
 (except the console) have left the scene.
 @c
        if( MCgetClient() != mal_clients){
-                       stream_printf(mal_clients->fdout,"#MALexit: non-admin 
attempt\n");
+               stream_printf(mal_clients->fdout,"#MALexit: non-admin 
attempt\n");
                return;
        }
        do{
-               activeClients=0;
                for(cntxt= mal_clients+1;  cntxt<mal_clients+MAL_MAXCLIENTS; 
cntxt++)
-               if( cntxt->mode != FREECLIENT)
-                       activeClients++;
-               if( activeClients) {
-                       stream_printf(mal_clients->fdout,"#MALexit: clients 
still active\n");
+                       cnt[cntxt->mode]++;
+               if( cnt[FINISHING]+cnt[CLAIMED]+cnt[AWAITING] ) 
                        MT_sleep_ms(1000);
-               }
-       } while (activeClients && reruns++ < 3);
+               if(reruns) 
+                       stream_printf(mal_clients->fdout,"#MALexit: clients 
still active\n");
+       } while (cnt[FINISHING]+cnt[CLAIMED]+cnt[AWAITING] && ++reruns < 3);
        if( reruns== 3)
-               stream_printf(mal_clients->fdout,"#MALexit: server forced 
exit\n");
+               stream_printf(mal_clients->fdout,"#MALexit: server forced exit"
+                       " %d finishing %d claimed %d waiting\n", 
+                       cnt[FINISHING],cnt[CLAIMED],cnt[AWAITING]);
 @c
 #if 0
        /* skip this to solve random crashes, needs work */


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to