Skip Menu |

This queue is for tickets about the DBD-SQLite CPAN distribution.

Report information
The Basics
Id: 60698
Status: resolved
Priority: 0/
Queue: DBD-SQLite

People
Owner: Nobody in particular
Requestors: ntyni [...] iki.fi
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.29
Fixed in: (no value)



Subject: Test failures with SQLite 3.7
As seen in http://bugs.debian.org/591111 t/08_busy.t and t/28_schemachange.t fail when building with SQLite 3.7.0. These are the only tests that fork child processes, and the problem is that these child processes clean up the database files while the parent has them open. This used to work with earlier SQLite versions, but the newer ones try to stat() the database file when acquiring a write lock. Proposed patch attached, this fixes it for us. Thanks for your work on DBD-SQLite, -- Niko Tyni (Debian Perl Group) ntyni@debian.org
Subject: 0001-Don-t-clean-temporary-files-in-child-processes.patch
From 89c8a661e61bbf0fb1d1e5050262390649e13f2a Mon Sep 17 00:00:00 2001 From: Niko Tyni <ntyni@debian.org> Date: Mon, 23 Aug 2010 08:15:15 +0300 Subject: [PATCH] Don't clean temporary files in child processes As of SQLite 3.7.0, write locks try to stat() the database file and fail with a 'Disk I/O error' if it is missing. This breaks those tests that fork child processes (namely 08_busy.t and t/28_schemachange.t) because the child process removes the database file in the END block. The fix is to disable the clean() function for child processes. See <http://bugs.debian.org/591111> --- t/lib/Test.pm | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/t/lib/Test.pm b/t/lib/Test.pm index 80e50ce..8d1be25 100644 --- a/t/lib/Test.pm +++ b/t/lib/Test.pm @@ -7,6 +7,7 @@ use Exporter (); use File::Spec (); use Test::More (); +my $parent; use vars qw{$VERSION @ISA @EXPORT @CALL_FUNCS}; BEGIN { $VERSION = '1.29'; @@ -15,6 +16,7 @@ BEGIN { # Allow tests to load modules bundled in /inc unshift @INC, 'inc'; + $parent = $$; } # Always load the DBI module @@ -22,6 +24,7 @@ use DBI (); # Delete temporary files sub clean { + return if $$ != $parent; unlink( 'foo' ); unlink( 'foo-journal' ); } -- 1.7.1
Subject: Re: [rt.cpan.org #60698] Test failures with SQLite 3.7
Date: Tue, 24 Aug 2010 17:01:59 -0700
To: bug-DBD-SQLite [...] rt.cpan.org
From: Darren Duncan <darren [...] darrenduncan.net>
ntyni@iki.fi via RT wrote: Show quoted text
> As seen in http://bugs.debian.org/591111 t/08_busy.t and > t/28_schemachange.t fail when building with SQLite 3.7.0. These are the > only tests that fork child processes, and the problem is that these > child processes clean up the database files while the parent has them open. > > This used to work with earlier SQLite versions, but the newer ones try > to stat() the database file when acquiring a write lock. > > Proposed patch attached, this fixes it for us.
Thank you for the patch, which fixes the problem for me as well. It has been applied to trunk, which has SQLite 3.7.2, and will hopefully be on CPAN as another developer-status release shortly. -- Darren Duncan
Hi. DBD::SQLite 1.30_04/05 with the patch applied was released. Thanks. On Tue Aug 24 20:02:08 2010, darren@DarrenDuncan.net wrote: Show quoted text
> ntyni@iki.fi via RT wrote:
> > As seen in http://bugs.debian.org/591111 t/08_busy.t and > > t/28_schemachange.t fail when building with SQLite 3.7.0. These are
> the
> > only tests that fork child processes, and the problem is that these > > child processes clean up the database files while the parent has
> them open.
> > > > This used to work with earlier SQLite versions, but the newer ones
> try
> > to stat() the database file when acquiring a write lock. > > > > Proposed patch attached, this fixes it for us.
> > Thank you for the patch, which fixes the problem for me as well. It > has been > applied to trunk, which has SQLite 3.7.2, and will hopefully be on > CPAN as > another developer-status release shortly. -- Darren Duncan