Skip to content

Version 5.38: Parallel::ForkManager = rmtree Error #146

@sskopnik

Description

@sskopnik

Hi,
when using Parallel::ForkManager temporary directories are created for every spawned process. Later these dirs are removed using rmtree in DESTROY of Temp.pm
Using Excel::Writer::XLSX in the child processes results in an error when trying to delete these dirs. This worked fine under 5.32

Simple Test script throws:
cannot remove directory for C:/Users/mxxxxx/AppData/Local/Temp/RstWAjVdoy: Directory not empty at C:/Perl64_new/perl/lib/File/Temp.pm line 2643.
cannot remove directory for C:/Users/mxxxxx/AppData/Local/Temp/fvjigK5GMN: Directory not empty at C:/Perl64_new/perl/lib/File/Temp.pm line 2643.

# Test script
use Spreadsheet::WriteExcel;
use Excel::Writer::XLSX;
use Parallel::ForkManager;

sub genXls {
  my $pm = Parallel::ForkManager->new(2);
  
  foreach my $file ('test.xlsx', 'test2.xlsx') {
    my $pid = $pm->start and next;
    srand();
    my $workbook;
    $workbook = Excel::Writer::XLSX->new($file);
    $workbook->close() or die "Error File close";
    $pm->finish; # Terminates the child process
  }
  $pm->wait_all_children; 
}  
genXls();

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstream moduleIssue is due to an upstream module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions