amflush run while amdump underway tries to flush .tmp files

2017-11-16 Thread Nathan Stratton Treadway
(Amanda v3.5) I noticed that Amanda 3.5 no longer aborts amflush if amdump is currently running (as older versions of Amanda do). So out of curiousity I kicked of "amflush TestBackup" while amdump was busy dumping to the holding disk... and I discovered that amflush actually tries to go ahead an

Re: amflush run while amdump underway tries to flush .tmp files

2017-11-19 Thread Jose M Calhariz
Hi, I have a user that have reported this problem and with a suspection that amflush could flush the temporary files. I leave here the link to the bugreport: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=881754 Kind regards Jose M Calhariz On Fri, Nov 17, 2017 at 12:38:12AM -0500, Nathan

Re: amflush run while amdump underway tries to flush .tmp files

2017-11-20 Thread Jean-Louis Martineau
Each process should take a lock on the holding directory (a pid file), The attached path fix it. Please try it. On 17/11/17 12:38 AM, Nathan Stratton Treadway wrote: > (Amanda v3.5) > > I noticed that Amanda 3.5 no longer aborts amflush if amdump is > currently running (as older versions of Ama

Re: amflush run while amdump underway tries to flush .tmp files

2017-11-20 Thread Nathan Stratton Treadway
On Mon, Nov 20, 2017 at 14:42:01 -0500, Jean-Louis Martineau wrote: > Each process should take a lock on the holding directory (a pid file), Okay, makes sense. > + my $pidfn = File::Spec->catfile($dirfn, "pid"); > + if (open(my $pidh, $pidfn)) { > + my $pid = <$pidh

Re: amflush run while amdump underway tries to flush .tmp files

2017-11-20 Thread Jean-Louis Martineau
On 20/11/17 02:56 PM, Nathan Stratton Treadway wrote: > On Mon, Nov 20, 2017 at 14:42:01 -0500, Jean-Louis Martineau wrote: > > Each process should take a lock on the holding directory (a pid file), > > Okay, makes sense. > > > > + my $pidfn = File::Spec->catfile($dirfn, "pid"); > > + if (open(my $

Re: amflush run while amdump underway tries to flush .tmp files

2017-11-20 Thread Nathan Stratton Treadway
On Mon, Nov 20, 2017 at 14:42:01 -0500, Jean-Louis Martineau wrote: > + if (open(my $pidh, $pidfn)) { > + my $pid = <$pidh>; > + if (kill($pid, 0) == 0) { > + # pid is alive, skip this directory > + next; > + } looks like

Re: amflush run while amdump underway tries to flush .tmp files

2017-11-20 Thread Nathan Stratton Treadway
On Mon, Nov 20, 2017 at 19:03:52 -0500, Nathan Stratton Treadway wrote: > On Mon, Nov 20, 2017 at 14:42:01 -0500, Jean-Louis Martineau wrote: > > + if (open(my $pidh, $pidfn)) { > > + my $pid = <$pidh>; > > + if (kill($pid, 0) == 0) { > > + # pid is alive, s

Re: amflush run while amdump underway tries to flush .tmp files

2017-11-21 Thread Jean-Louis Martineau
Nathan, There is no patch attached on your email. I do not see how Amanda::Util::setup_application call code in holding.c Jean-Louis On 21/11/17 02:52 AM, Nathan Stratton Treadway wrote: > On Mon, Nov 20, 2017 at 19:03:52 -0500, Nathan Stratton Treadway wrote: > > On Mon, Nov 20, 2017 at 14:42:

Re: amflush run while amdump underway tries to flush .tmp files

2017-11-21 Thread Nathan Stratton Treadway
On Tue, Nov 21, 2017 at 11:45:52 -0500, Jean-Louis Martineau wrote: > There is no patch attached on your email. Ah, sorry, attached here. > > I do not see how Amanda::Util::setup_application call code in holding.c To be precise what I actually saw was activity involving the "pid" files in the h

Re: amflush run while amdump underway tries to flush .tmp files

2017-11-21 Thread Nathan Stratton Treadway
On Tue, Nov 21, 2017 at 12:57:00 -0500, Nathan Stratton Treadway wrote: > > I do not see how Amanda::Util::setup_application call code in holding.c > > To be precise what I actually saw was activity involving the "pid" files > in the holding directory showing up in an strace log. I am not sure ho

Re: amflush run while amdump underway tries to flush .tmp files

2017-11-21 Thread Nathan Stratton Treadway
On Mon, Nov 20, 2017 at 15:09:25 -0500, Jean-Louis Martineau wrote: > perl automatically close it when it come out of scope. > The close should before the 'if (kill' line. Okay, I moved the close() line up to that spot as I applied the patch. I can confirm that with your patch applied and my foll

Re: amflush run while amdump underway tries to flush .tmp files

2017-11-22 Thread Jean-Louis Martineau
Nathan, search_holding_disk should not take the pid file. Jean-Louis On 21/11/17 06:49 PM, Nathan Stratton Treadway wrote: > On Tue, Nov 21, 2017 at 12:57:00 -0500, Nathan Stratton Treadway wrote: > > > I do not see how Amanda::Util::setup_application call code in > holding.c > > > > To be prec

Re: amflush run while amdump underway tries to flush .tmp files

2017-11-22 Thread Jean-Louis Martineau
For amdump, it is the planner that create the pid file, it must put its ppid in it (amdump process) (done in holding.c) For amflush, it is amflush that create the pid file, it must put its pid in it (done in Holding.pm) In both case, the driver call cleanup_holding to remove the pid, you are rig

Re: amflush run while amdump underway tries to flush .tmp files

2017-11-22 Thread Jean-Louis Martineau
Nathan, I committed the attached patch, It fix all the issues I saw. Can you try to use the SVN or GIT repository? they have other fixes. SVN: 1. svn checkout svn://svn.code.sf.net/p/amanda/code/amanda/branches/3_5 amanda-3-5 2. cd amanda-3-5 3. ./autogen 4. ./configure 5. make G

Re: amflush run while amdump underway tries to flush .tmp files

2017-11-24 Thread Jose M Calhariz
I am interested in this fix. There is a final patch? Or is better to use the code from git? Kind regards JOse M Calhariz On Tue, Nov 21, 2017 at 12:57:00PM -0500, Nathan Stratton Treadway wrote: > On Tue, Nov 21, 2017 at 11:45:52 -0500, Jean-Louis Martineau wrote: > > There is no patch attache