ANNOUNCE: DBIx::Timeout v1.00
- From: sam@xxxxxxxxxx (Sam Tregar)
- Date: Sun, 17 Sep 2006 00:36:51 -0400 (EDT)
Changes
- First release!
Description
This module provides a safe method of timing out DBI requests. An
unsafe method is described in the DBI docs:
http://search.cpan.org/~timb/DBI/DBI.pm#Signal_Handling_and_Canceling_Operations
The problem with using POSIX sigaction() (the method described
above) is that it relies on unsafe signals to work. Unsafe
signals are well known to cause instability. To understand why,
imagine the DB client code is in the middle of updating some
global state when the signal arrives. That global state could be
left in an inconsitent state, just waiting for the next time it is
needed to cause problems. Since this will likely occur far from
the cause, and only ocur rarely, it can be a very difficult
problem to track down.
Instead, this module:
- Forks a child process which sleeps for $timeout seconds.
- Runs your long-running query in the parent process.
- If the parent process finishes first it kills the child and
returns.
- If the child process wakes up it kills the parent's DB thread
and exits with a code so the parent knows it was timed out.
Download
You can get DBIx::Timeout using the CPAN shell or at:
http://search.cpan.org/~samtregar/DBIx-Timeout/
.
- Prev by Date: Re: New here. dbi:DBM:mldbm=Storable;f_dir=/foo/bar. Inserts when asked to update and other weirdness
- Next by Date: Re: Safely timing out DBI queries
- Previous by thread: New here. dbi:DBM:mldbm=Storable;f_dir=/foo/bar. Inserts when asked to update and other weirdness
- Next by thread: DBI->connect() fails
- Index(es):