Subject: | Temporary directory remains - Change default behavior to auto-clean |
Date: | Thu, 30 Jan 2014 08:54:57 -0500 |
To: | "bug-Parallel-ForkManager [...] rt.cpan.org" <bug-Parallel-ForkManager [...] rt.cpan.org> |
From: | Tal Cohen <tcohen [...] sitespect.com> |
Environment Information:
Perl Version: 5.8.9
Parallel::ForkManager version: 1.0.5
Linux Kernel: 2.6.39.3
Linux Distribution: CRUX version 2.5
Issue:
Temporary files are not removed from /tmp
Underlying Cause:
In ForkManager.pm, when a new instance is created, line 456 sets the auto_cleanup flag to 0 unless a temp directory is set:
my $h={
max_proc => $processes,
processes => {},
in_child => 0,
parent_pid => $$,
auto_cleanup => ($tempdir ? 1 : 0),
};
Setting auto_cleanup to 0 prevents the Destroy function from deleting the temp directory that was created.
Temporary Workaround:
I've been setting auto_cleanup to 1 in my code. For instance:
my $pm = new Parallel::ForkManager();
$pm->{auto_cleanup} = 1;
Requested Solution:
Default auto_cleanup to 1 in ForkManager.pm:
my $h={
max_proc => $processes,
processes => {},
in_child => 0,
parent_pid => $$,
auto_cleanup => 1,
};
Tal Cohen
Director of Special Projects
[cid:image001.gif@01CF1D98.33A94700]<http://www.sitespect.com/>
Tel: 617-859-1900, x705
Follow us on Twitter: @SiteSpect
Please note that the information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us by replying to the message and deleting it from your computer.