DB Timeouts
Results 1 to 7 of 7

Thread: DB Timeouts

  1. #1
    Senior Member
    Join Date
    Apr 2002
    Posts
    712

    DB Timeouts

    Unfortunately I lost the piece off my clipboard... but it appears as though the pieces of the board that connect to the DB do not fail gracefully in the event of DB timeout (more than 30 seconds). About 7:25pm, looks like the DB crashed or, for some reason, wasn't reachable from the website. Pages came back with a couple PHP warnings... again, I apologize... Windows wasn't cooperating and I lost the exact error messages (think one was on line 68, though).

    Ideally PHP should just load a default "sorry, something's not working" page instead of barfing the errors on to the screen.
    \"Windows has detected that a gnat has farted in the general vicinity. You must reboot for changes to take affect. Reboot now?\"
    Share on Google+

  2. #2
    The Iceman Cometh
    Join Date
    Aug 2001
    Posts
    1,210
    I think a few other people have mentioned it as well. Something about c:\apache..... I had the problem once, but just refreshed the page and it was gone.

    AJ
    Share on Google+

  3. #3
    Senior Member
    Join Date
    Apr 2002
    Posts
    712
    It burped for a while tonight... just now, again...

    Code:
    Fatal error: Maximum execution time of 30 seconds exceeded in c:\apache\htdocs\admin\db_mysql.php on line 82
    
    Fatal error: Maximum execution time of 30 seconds exceeded in c:\apache\htdocs\admin\functions.php on line 2640
    
    
    Fatal error: Maximum execution time of 30 seconds exceeded in c:\apache\htdocs\index.php on line 238
    
    Fatal error: Maximum execution time of 30 seconds exceeded in c:\apache\htdocs\admin\functions.php on line 2640
    \"Windows has detected that a gnat has farted in the general vicinity. You must reboot for changes to take affect. Reboot now?\"
    Share on Google+

  4. #4
    Senior Member
    Join Date
    Apr 2002
    Posts
    712
    Think some of the things that may need/like to be added here to prevent people from seeing this... if I may so bold as to offer some possible assistance (semi-pseudo code, at least):

    Code:
      // Turn off error reporting back to the page:
      //    http://www.php.net/manual/en/functio...-reporting.php
      error_reporting( 0 );
    
      [...]
    
      // Handle fatal errors and give user a "blank stare" page.
      // Set to the user defined error handler
      $old_error_handler = set_error_handler("handleError");
    
      [...]
    
      // Restore the old error handler now that we're out of the weeds...
      restore_error_handler();
    
    //----------------------------------------------------------------------
    // error handler function
    
    function
    handleError ($errno, $errstr, $errfile, $errline)
    
    {
      // Switch to send out appropriate mail messages to alert folks...
      //
      // bool mail ( string to, string subject, string message
      //             [, string additional_headers
      //             [, string additional_parameters]]
      //           )
    
      switch ($errno) {
    
      case FATAL:
        mail( "root+fatal@antionline.com", "FATAL ERROR [$errno] $errstr",
              "Fatal error in line " . $errline . " of file " . $errfile .
              ", PHP " . PHP_VERSION . " (" . PHP_OS . ")\n"
            );
        break;
    
      case ERROR:
        mail( "root+error@antionline.com", "ERROR [$errno] $errstr",
              "ERROR in line " . $errline . " of file " . $errfile .
              ", PHP " . PHP_VERSION . " (" . PHP_OS . ")\n"
            );
        break;
    
      case WARNING:
        mail( "root+warning@antionline.com", "WARNING [$errno] $errstr",
              "WARNING in line " . $errline . " of file " . $errfile .
              ", PHP " . PHP_VERSION . " (" . PHP_OS . ")\n"
            );
        break;
    
      default:
        mail( "root+defaulterror@antionline.com", "UNKNOWN [$errno] $errstr",
              "UNKNOWN error in line " . $errline . " of file " . $errfile .
              ", PHP " . PHP_VERSION . " (" . PHP_OS . ")\n"
            );
        break;
      }
    
      //
      // Show the user a blank page...
      print( "<HTML>\n<HEAD>\n" );
      print( "<TITLE>AntiOnline - Error</TITLE>\n" );
      print( "</HEAD>\n\n<BODY>\nSorry - an error has occurred.\n" );
      print( "</BODY>\n</HTML>\n" );
    
      // EXIT the code here to prevent further execution in unforseen parts
      // of the code.
      exit 1;
    }
    
    
    //----------------------------------------------------------------------
    \"Windows has detected that a gnat has farted in the general vicinity. You must reboot for changes to take affect. Reboot now?\"
    Share on Google+

  5. #5
    The Iceman Cometh
    Join Date
    Aug 2001
    Posts
    1,210
    There's another thread also discussing this topic (though not nearly as intelligently as you) HERE

    AJ
    Share on Google+

  6. #6
    Just got some more:

    Fatal error: Maximum execution time of 30 seconds exceeded in c:\apache\htdocs\admin\db_mysql.php on line 82

    Fatal error: Maximum execution time of 30 seconds exceeded in c:\apache\htdocs\admin\functions.php on line 2640

    I thought we were on a UNIX box what the heck?
    Share on Google+

  7. #7
    Banned
    Join Date
    Jul 2001
    Posts
    1,100
    Greetings All:

    Problem fixed, thanks.
    Share on Google+

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 Security News

     Patches

       Security Trends

         How-To

           Buying Guides