At 14/10/2004 14/10/2004 -0500, you wrote:

Several people, myself included, are still seeing problems with MySQL under a large useage. So far I have not been able to get to the cause of the problem other than to convince myself I have no network or MySQL issues. I don't know C well enough to add debug code or create a patch for this, but I am still having users who have to authenticate twice and the MySQL errors I record point to improper closing of the tables, causing a communication failure.

I feel most of the critical "closing" routines (for any MySQL or DB or socket or file) should be chained using an atexit() function.


Calls chained using atexit are always called when program is exiting in the normal way (i.e. excluding some special SIG).

That would guarantee that ANY normal program will ALWAYS close opened connections.

It should be enought simple to implement such a control.

Each DB module could be coded like (sorry for the strange metacode used here):

static int dbopened = 0;

safeclosedb ()
{
  if (dbopened == 1) {
    close (DB);
    dbopened = 0;
  }
}

        ......
        open (DB);
        if ERROR {
                go away
        }

        dbopened = 1;
        atexit (safeclosedb)
        .......
        .......
        .......
        close (DB);
        dbopened = 0;
        .........


Ciao,

Tonino

I can give details if interested, and I am willing to be the guinea pig and test the code.

DAve



--
Systems Administrator
http://www.tls.net
Get rid of Unwanted Emails...get TLS Spam Blocker!

------------------------------------------------------------ [EMAIL PROTECTED] Interazioni di Antonio Nati http://www.interazioni.it [EMAIL PROTECTED] ------------------------------------------------------------



Reply via email to