Debian Bug report logs - #319177
some patchs

Package: debconf; Maintainer for debconf is Debconf Developers <[email protected]>; Source for debconf is src:debconf (PTS, buildd, popcon).

Reported by: [email protected]

Date: Wed, 20 Jul 2005 10:48:02 UTC

Severity: normal

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Joey Hess <[email protected]>:
Bug#319177; Package debconf. (full text, mbox, link).


Acknowledgement sent to [email protected]:
New Bug report received and forwarded. Copy sent to Joey Hess <[email protected]>. (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: [email protected]
To: [email protected]
Subject: some patchs
Date: Wed, 20 Jul 2005 12:44:44 +0200
[Message part 1 (text/plain, inline)]

Package: debconf

   * Sylvain Ferriol
     - set the type of the template in Template::new because if we don't
       use Template::load, it do not appear in template instance
     - modify debconf.schema because extendedDescription attribute has an
       inappropriate matching rule => slapd (2.2.23-8) failed
     - call Cache::shutdown in File::shutdown to synchronize data between
       cache and file. see
Test::Debconf::DbDriver::CommonTest::test_shutdown
     - call Cache::shutdown in LDAP::shutdown to synchronize data between
       cache and ldap. see
Test::Debconf::DbDriver::CommonTest::test_shutdown
     - add unit tests to validate debconf_copydb.
     - add Test::CopyDBTest::test_201431. Closes: #201431


-------------------------------------------------
envoyé via Webmail/IMAG !
[debconf-1.4.51-1.4.52.patch.gz (application/x-gzip, attachment)]

Information forwarded to [email protected]:
Bug#319177; Package debconf. (full text, mbox, link).


Acknowledgement sent to Joey Hess <[email protected]>:
Extra info received and forwarded to list. (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Joey Hess <[email protected]>
To: [email protected], [email protected]
Subject: Re: Bug#319177: some patchs
Date: Wed, 20 Jul 2005 10:56:12 -0400
[Message part 1 (text/plain, inline)]
>      - call Cache::shutdown in File::shutdown to synchronize data between
>        cache and file.

I've applied the other patches, but it seems that this part of the patch
has a bug. Consider saving a file, when nothing in the cache is dirty.
With your patch, DbDriver::File::shutdown opens the file for write, then
calls the DDriver::Cache::shutdown. This loops over removed and dirty
items and calls the remove and save methods for them.

But at no point does it re-save clean items back to the file, so the
file ends up containing only items that were dirtied in the cache during
this run. The rest are deleted.

I'm also interested to know whether you found an actual problem that
your change above fixes.

-- 
see shy jo
[signature.asc (application/pgp-signature, inline)]

Information forwarded to [email protected], Joey Hess <[email protected]>:
Bug#319177; Package debconf. (full text, mbox, link).


Acknowledgement sent to [email protected]:
Extra info received and forwarded to list. Copy sent to Joey Hess <[email protected]>. (full text, mbox, link).


Message #15 received at [email protected] (full text, mbox, reply):

From: [email protected]
To: Joey Hess <[email protected]>
Cc: [email protected]
Subject: Re: Bug#319177: some patchs
Date: Fri, 22 Jul 2005 10:52:56 +0200
Surlignage Joey Hess <[email protected]>:

> >      - call Cache::shutdown in File::shutdown to synchronize data between
> >        cache and file.
> 
> I've applied the other patches, but it seems that this part of the patch
> has a bug. 
True

> I'm also interested to know whether you found an actual problem that
> your change above fixes.
> 
The problem is that all drivers use Cache::shutdown except File driver.
And after a shutdown, all items are not dirty except using File driver.

It is not a bug, but if we re-init the driver after a shutdown, there will be
items in dirty state but they should not be.

So if we don't use Cache:shutdown, we have to reset the dirty flag in
File::shutdown by adding this line in File.pm:

foreach my $item (sort keys %{$this->{cache}}) {
  next unless defined $this->{cache}->{item}; # skip deleted
  $this->{format}->write($fh, $this->{cache}->{$item}, item);
+ $this->{dirty}->{$item}=0 if defined $this->{dirty}->{$item};
}

and the unit tests will work ;) :
./test_debconf.pl Test::Debconf::DbDriver::FileTest
.....
OK (5 tests)




> -- 
> see shy jo
> 




-------------------------------------------------
envoyé via Webmail/IMAG !




Information forwarded to [email protected]:
Bug#319177; Package debconf. (full text, mbox, link).


Acknowledgement sent to Joey Hess <[email protected]>:
Extra info received and forwarded to list. (full text, mbox, link).


Message #20 received at [email protected] (full text, mbox, reply):

From: Joey Hess <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: Bug#319177: some patchs
Date: Fri, 22 Jul 2005 10:52:58 -0400
[Message part 1 (text/plain, inline)]
[email protected] wrote:
> The problem is that all drivers use Cache::shutdown except File driver.
> And after a shutdown, all items are not dirty except using File driver.
> 
> It is not a bug, but if we re-init the driver after a shutdown, there will be
> items in dirty state but they should not be.
> 
> So if we don't use Cache:shutdown, we have to reset the dirty flag in
> File::shutdown by adding this line in File.pm:
> 
> foreach my $item (sort keys %{$this->{cache}}) {
>   next unless defined $this->{cache}->{item}; # skip deleted
>   $this->{format}->write($fh, $this->{cache}->{$item}, item);
> + $this->{dirty}->{$item}=0 if defined $this->{dirty}->{$item};
> }
> 
> and the unit tests will work ;) :
> ./test_debconf.pl Test::Debconf::DbDriver::FileTest
> .....
> OK (5 tests)

Ok, I can do that; an alternative approach might be to call shutdown but
have dummy save/remove methods that do nothing.

This is all a bit ugly, the best fix would be a new interface in the
cache dbdriver that lets file dbdriver avoid needing to touch its
internals.

-- 
see shy jo
[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Thu Nov 14 10:33:37 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.