in reply to fork() and defunct children
Do you open your $dbh before you fork? If so, the child may be meddling with it. Have a look at DBI, fork, and clone. for the gory details, but the nutshell version is that any connection open when the fork happens will be owned by two processes. This means that when the child exits, it will disconnect the parent's connection. It also means that if they're both trying to use it for access, they're going to get very confused.
A simple way to handle this is not to have a connection open during the fork.
The other way to handle it is to have the child set $dbh->{InactiveDestroy} = 1 and then undef the $dbh.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: fork() and defunct children
by Anonymous Monk on Feb 12, 2008 at 22:50 UTC | |
by kyle (Abbot) on Feb 13, 2008 at 03:19 UTC |