in reply to Re^3: Race condition in my cron daemon
in thread Race condition in my cron daemon

Nope - still getting the same issue. I have added these lines to the code for the child process:

# Child # Get rid of old database connections > $lock->{InactiveDestroy} = 1; > undef $lock; > undef $db; MyStuff::DB::clear_cache(); chdir '/' or die $!;

I still get the same issue where the parent locks the 'jobs' table, then when it tries to use the same dbh to write the new PID, it hangs, waiting for the lock.

This only happens sporadically, and only when the child process has something to do (so that it takes fractionally longer to complete than usual), but not always...

Further help would be greatly appreciated...

clint