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

Modified Files:
        mal_client.mx mal_scenario.mx 
Log Message:
Added state information to ease bringing down a running server.
The time of the last request is kept around to detect dormant clients.
The process stage can be used to assess their activity.
This change may require a fresh built due to a new field in the client record.


Index: mal_client.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_client.mx,v
retrieving revision 1.155
retrieving revision 1.156
diff -u -d -r1.155 -r1.156
--- mal_client.mx       28 Aug 2007 11:03:28 -0000      1.155
+++ mal_client.mx       30 Aug 2007 07:18:54 -0000      1.156
@@ -130,6 +130,7 @@
        str     srcFile;        /* NULL for stdin, or file name */
        void    *state[7], *oldstate[7];
        MALfcn  phase[7], oldphase[7];
+       sht             stage;          /* keep track of the phase being ran */
        char    itrace;     /* trace execution using interactive mdb */
                                                /* if set to 'S' it will put 
the process to sleep */
        short   debugOptimizer,debugScheduler;
@@ -155,8 +156,8 @@
 Future releases may support a re-connect facility.  [TODO]
 @h
        time_t      login;  
-       time_t      logout;
-       time_t      delay;
+       time_t      lastcmd;    /* set when input is received */
+       time_t      delay;              /* not yet used */
 @-
 Communication channels for the interconnect are stored here.
 It is perfectly legal to have a client without input stream.
@@ -430,9 +431,10 @@
        c->glb = 0;
 
        c->father = NULL;
-       c->login = time(0); c->delay= TIMEOUT;
-       c->logout= c->login+c->delay;
+       c->login = c->lastcmd= time(0);
+       c->delay= TIMEOUT;
        c->mode = AWAITING;
+       c->stage = 0;
        c->itrace = 0;
        c->debugOptimizer = c->debugScheduler= 0;
        c->timer = 0;
@@ -584,7 +586,7 @@
                c->errbuf=0;
        }
        c->father = 0;
-       c->login = c->delay = c->logout = 0;
+       c->login = c->delay = c->lastcmd = 0;
 @-
 The threads may not be removed, but should become dormant
 @c

Index: mal_scenario.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_scenario.mx,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -d -r1.110 -r1.111
--- mal_scenario.mx     1 Jul 2007 22:03:09 -0000       1.110
+++ mal_scenario.mx     30 Aug 2007 07:18:54 -0000      1.111
@@ -550,6 +550,7 @@
 @-
 @{
 @= runPhase
+       c->stage= @1;
        if(msg== MAL_SUCCEED && c->[EMAIL PROTECTED] && ((msg= (str) 
(*c->[EMAIL PROTECTED])(c)) ||  c->mode <= FINISHING)){
                /* error occurred */
 #ifdef MAL_SCENARIO_DEBUG
@@ -579,6 +580,7 @@
        while (c->mode > FINISHING) {
                msg = MAL_SUCCEED;
                @:runPhase(MAL_SCENARIO_READER)@
+               c->lastcmd= time(0);
                @:runPhase(MAL_SCENARIO_PARSER)@
                @:runPhase(MAL_SCENARIO_OPTIMIZE)@
                @:runPhase(MAL_SCENARIO_SCHEDULER)@


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to