Bug#760141: apt-cacher: multiple apt-cacher-cleanup.pl processes

2014-10-26 Thread Mark Hindley
package apt-cacher
tags 760141 +moreinfo
thanks

I will leave this open for now, just in case anybody else is having the same
problem.

Mark


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#760141: apt-cacher: multiple apt-cacher-cleanup.pl processes

2014-09-01 Thread Dmitry Smirnov
Package: apt-cacher
Version: 1.7.9.1
Severity: normal

Today I found many apt-cacher-cleanup.pl processes run by cron on my system 
so I had to knock them down with sudo killall apt-cacher-cleanup.pl.

To my surprise it happened despite AUTOSTART=0 in /etc/default/apt-cacher.

Let alone reason why this process did not terminate within reasonable time I'd 
like to highlight the following problems:

 * cleaner may start multiple times if already running one(s) did not finish.
 * cleaner runs disregarding of AUTOSTART=0 in /etc/default/apt-cacher.
 * lack of POD documentation 
   (i.e. perldoc /usr/share/apt-cacher/apt-cacher-cleanup.pl report
No documentation found).

I did not investigate why cleanup did not finish but I suspect that it somehow 
might be due to active apt-cacher-ng...
When I run sudo /usr/share/apt-cacher/apt-cacher-cleanup.pl -v it finished 
without reporting any errors...

-- 
Best wishes,
 Dmitry Smirnov
 GPG key : 4096R/53968D1B

---

It is no use saying, 'We are doing our best.' You have got to succeed
in doing what is necessary.
-- Winston Churchill


signature.asc
Description: This is a digitally signed message part.


Bug#760141: apt-cacher: multiple apt-cacher-cleanup.pl processes

2014-09-01 Thread Mark Hindley
On Mon, Sep 01, 2014 at 06:53:49PM +1000, Dmitry Smirnov wrote:
 Package: apt-cacher
 Version: 1.7.9.1
 Severity: normal
 
 Today I found many apt-cacher-cleanup.pl processes run by cron on my system 
 so I had to knock them down with sudo killall apt-cacher-cleanup.pl.
 
 To my surprise it happened despite AUTOSTART=0 in /etc/default/apt-cacher.

AUTOSTART only refers to the daemon process. apt-cacher-cleanup.pl is run by a
cron job from /etc/cron.d/apt-cacher

 Let alone reason why this process did not terminate within reasonable time 
 I'd 
 like to highlight the following problems:
 
  * cleaner may start multiple times if already running one(s) did not finish.

That shouldn't happen as there is a lock to ensure only a single running
process. If this was running on a cache directory where apt-cacher-ng was taking
locks, I suspect these were not multiple instances, but the various forks that
apt-cacher-cleanup.pl performs. It is supposed to run quietly and at very low
priority in the background.

  * cleaner runs disregarding of AUTOSTART=0 in /etc/default/apt-cacher.

See above. 

  * lack of POD documentation 
(i.e. perldoc /usr/share/apt-cacher/apt-cacher-cleanup.pl report
 No documentation found).

I accept this, but apt-cacher-cleanup.pl -h does provide something and it is
also mentioned in apt-cacher(8).

 I did not investigate why cleanup did not finish but I suspect that it 
 somehow 
 might be due to active apt-cacher-ng...
 When I run sudo /usr/share/apt-cacher/apt-cacher-cleanup.pl -v it finished 
 without reporting any errors...

I cannot see evidence of a real bug here. My only solution would be to prevent
simultaneous installation of apt-cacher and apt-cacher-ng.

Best wishes

Mark


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#760141: apt-cacher: multiple apt-cacher-cleanup.pl processes

2014-09-01 Thread Dmitry Smirnov
Hi Mark,

Thank you for quick reply.


On Mon, 1 Sep 2014 10:18:19 Mark Hindley wrote:
  To my surprise it happened despite AUTOSTART=0 in
  /etc/default/apt-cacher.
 AUTOSTART only refers to the daemon process. apt-cacher-cleanup.pl is run by
 a cron job from /etc/cron.d/apt-cacher

Of course. I'm just wondering whether it make sense to run cleaner when daemon 
is disabled?


  Let alone reason why this process did not terminate within reasonable time
  I'd 
  like to highlight the following problems:
   * cleaner may start multiple times if already running one(s) did not
   finish.
 That shouldn't happen as there is a lock to ensure only a single running
 process. If this was running on a cache directory where apt-cacher-ng was
 taking locks, I suspect these were not multiple instances, but the various
 forks that apt-cacher-cleanup.pl performs. It is supposed to run quietly
 and at very low priority in the background.

Although I can't support it with hard evidence I'm pretty sure it was multiple 
processes, not forks of a one instance. I first noticed this issue with htop 
which is configured to hide threads by default. Every cleaner process was 
nested under cron. Process tree looked nothing like what I see when I 
manually start cleaner. Also killall released about 1 GiB of RAM while one 
cleaner instance do not use that much memory...


   * lack of POD documentation
   
 (i.e. perldoc /usr/share/apt-cacher/apt-cacher-cleanup.pl report
 
  No documentation found).
 
 I accept this, but apt-cacher-cleanup.pl -h does provide something and it is
 also mentioned in apt-cacher(8).

I found it of course but thanks anyway for mentioning.


 I cannot see evidence of a real bug here. My only solution would be to
 prevent simultaneous installation of apt-cacher and apt-cacher-ng.

apt-cacher was not active for several months on this system. I assumed it 
would be safe to disable daemon in /etc/default/apt-cacher. If there is a 
conflict with apt-cacher-ng then perhaps it could be considered to introduce 
conflicts or mention the clash in README. 

Anyway since I can't point out the root cause for the problem please feel free 
to close this bug if you wish.

Thank you.

-- 
All the best,
 Dmitry Smirnov.

---

What can be asserted without proof can be dismissed without proof.
-- Christopher Hitchens, 2004



signature.asc
Description: This is a digitally signed message part.


Bug#760141: apt-cacher: multiple apt-cacher-cleanup.pl processes

2014-09-01 Thread Mark Hindley
On Mon, Sep 01, 2014 at 08:11:38PM +1000, Dmitry Smirnov wrote:
 Hi Mark,
 
 Thank you for quick reply.
 
 
 On Mon, 1 Sep 2014 10:18:19 Mark Hindley wrote:
   To my surprise it happened despite AUTOSTART=0 in
   /etc/default/apt-cacher.
  AUTOSTART only refers to the daemon process. apt-cacher-cleanup.pl is run by
  a cron job from /etc/cron.d/apt-cacher
 
 Of course. I'm just wondering whether it make sense to run cleaner when 
 daemon 
 is disabled?

I think it does because apt-cacher can also be invoked from inetd or even in a
legacy (deprecated) CGI mode. In those cases AUTOSTART is 0 but cache
maintenance is required.
 
 apt-cacher was not active for several months on this system. I assumed it 
 would be safe to disable daemon in /etc/default/apt-cacher. If there is a 
 conflict with apt-cacher-ng then perhaps it could be considered to introduce 
 conflicts or mention the clash in README.

I don't know how apt-cacher-ng handles locking, but I can imagine there may be
problems if they are trying to lock files in the same cache directory at the
same time.
 
Best wishes

Mark


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#760141: apt-cacher: multiple apt-cacher-cleanup.pl processes

2014-09-01 Thread Dmitry Smirnov
On Mon, 1 Sep 2014 11:26:39 Mark Hindley wrote:
 I don't know how apt-cacher-ng handles locking, but I can imagine there may
 be problems if they are trying to lock files in the same cache directory at
 the same time.

I've never tried to share cache directory between apt-cacher and apt-cacher-
ng. Both of them use their own cache directories under /var/cache so I doubt 
if there is a lock collision...

-- 
Cheers,
 Dmitry Smirnov.



signature.asc
Description: This is a digitally signed message part.