Hi Perrin,

> It looks to me like there's no danger here, just an annoying error message.  
> Your connection from the parent process is being passed across the fork, but 
> then when each child process tries to check it with ping() it fails and a new 
> connection is opened to replace it.

It looks like we still can use the way we do with Apache::DBI safely. The child 
process creates the new connection and replaces the one that's inherited but 
not ping-able. Will the new connection that's created be cached after then and 
the connection that's not ping-able will be discarded? Will this cached the new 
connection last until the child process exit?

Will rollback be called when child process discovers the connection handle not 
ping-able?

Will rollback be called when child process exit?

Thanks,
- xinhuan

From: Perrin Harkins <phark...@gmail.com<mailto:phark...@gmail.com>>
Date: Monday, June 3, 2013 5:14 PM
To: Xinhuan Zheng <xzh...@christianbook.com<mailto:xzh...@christianbook.com>>
Cc: Jim Schueler <jschue...@eloquency.com<mailto:jschue...@eloquency.com>>, 
"modperl@perl.apache.org<mailto:modperl@perl.apache.org>" 
<modperl@perl.apache.org<mailto:modperl@perl.apache.org>>
Subject: Apache::DBI "connection lost contact" error

On Monday, June 3, 2013, Xinhuan Zheng wrote:
> What is the check to see if the server is restarting? Is that new child 
> processes spawning?

It's a test for whether or not we're running in the parent process, used to 
skip caching connections during startup. It's this, line 128:
if (Apache2::ServerUtil::restart_count() == 1) {

> If there is a bug in how it checks to see if the server is restarting, does 
> it affect putting it into production use?

It looks to me like there's no danger here, just an annoying error message.  
Your connection from the parent process is being passed across the fork, but 
then when each child process tries to check it with ping() it fails and a new 
connection is opened to replace it.

I'll investigate the possible bug further when I get back from the conference 
I'm at right now (YAPC::NA in Austin).

- Perrin

Reply via email to