On Fri, 20 Feb 2004, Dean Arnold wrote: > I'm getting an odd behavior that appears to be > different than Perl 5.6, hope you can shed some light. > > I have an app that opens a connection, then forks > some processes, which also open connections, do some stuff, > then exit. > > Thing is, when the children exit and their driver handle gets DESTROY'ed, > disconnect_all() is called to cleanup. But since the children > inherit the list of open connections from the parent process, > they destroy the parent's connection. The behavior occurs > on both Linux (Fedora 1) and OS X 10.3. > > This code has been used with Perl 5.6 and DBI 1.36 > without an issue, presumably because the driver handle got > recreated, but I don't see the driver() method get called > by the child processes, so the connection list exists as > inherited from the parent. > > Has something changed ? Can DBI see the > change and invoke the CLONE as for threads, or is this something > I need to handle internally by tracking PID's ?
Dean, Actually, the behavior you describe is a lingering problem when using the DBI::Proxy over the network. I've been picking away at the root cause, but until I get a round tuit and fix things, a good workaround is to ensure that children terminate through POSIX::_exit(). This bypasses all the destructors and prevents the connection from being shut down. Steve
