Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv32694

Modified Files:
        merovingian.mx 
Log Message:
Fix for bug #1913438 (Merovingian: no connections accepted untill first command)

Since I made the control channel non-blocking, the open() call blocks as
well.  This prevents merovingian from reaching the code where the TCP
sockets are handled until the first control command is sent, which
unblocks the open() call.

Instead, now block in the control runner thread itself.  This thread is
made for waiting on input ;)



Index: merovingian.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/merovingian.mx,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- merovingian.mx      22 Feb 2008 17:16:21 -0000      1.30
+++ merovingian.mx      13 Mar 2008 12:17:20 -0000      1.31
@@ -881,12 +881,13 @@
        char buf[256];
        char *p, *q;
        sabdb *stats;
-       int fd = *((int *)d);
+       int fd;
        int pos = 0;
 
        /* Try to handle control signals.  We can get race conditions due to
         * clients coming in at the same time.  We might need to fix this
         * situation sometime. */
+       fd = open((char *)d, O_RDONLY); /* note: this blocks */
        while (_keepListening == 1) {
                if (pos == 0) {
                        if ((pos = read(fd, buf, 255)) == 0) {
@@ -1378,8 +1379,7 @@
 
                /* handle control commands */
                snprintf(buf, 1024, "%s/.merovingian_control", dbfarm);
-               comfd = open(buf, O_RDONLY);
-               if (pthread_create(&ctid, NULL, (void *(*)(void 
*))controlRunner, (void *)&comfd) < 0) {
+               if (pthread_create(&ctid, NULL, (void *(*)(void 
*))controlRunner, (void *)buf) < 0) {
                        fprintf(stderr, "unable to create control command 
thread\n");
                        ctid = 0;
                }


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to