On Wed, 13 Aug 2003, Kalin KOZHUHAROV wrote:

> B. Tolka wrote:
> > In my logs I keep getting error messages like this every few hours. The 
> > wait_timout on mysql is 28800.  
> > 
> > DBD::mysql::st execute failed: Lost connection to MySQL server during query
> 
> Are you using fork? Or system or exec?
> 
> In other words, are two processes/threads trying to talk to the
> server on the same channel? I run upon this error before
> understanding that this is impossible. Fork, then connect to the
> database is the clean approach.

Thank you!  I've been trying to track down the cause of this error for
a few months now.  A test script in my current project goes through
lib/ and looks for Perl modules that implement a particular interface,
which it then tests.  Sometimes, but not always, it would produce the
Lost connection error above.  It turns out that one of the Perl
modules fork()s in a BEGIN block when loaded!  So even though that
module wasn't being tested it would cause the test script to fork as
soon as it was loaded.

I never would have thought to look for fork()s without your hint.
Thanks!

-sam

Reply via email to