Commit 834b7a34 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

Cleaning-up /tmp is now optional (until we have assessed its impact on beekeeper

parent 738b235c
......@@ -7,6 +7,7 @@
"SubmitWorkersMax" : 50
},
"Meadow" : {
"CleanupTempDirectoryKilledWorkers" : 0,
"LOCAL" : {
"TotalRunningWorkersMax" : 2,
"my-quadcore-desktop" : {
......
......@@ -443,7 +443,6 @@ sub check_for_dead_workers { # scans the whole Valley for lost Workers (but i
$worker->cause_of_death( $report_entries->{$process_id}{'cause_of_death'} );
$self->register_worker_death( $worker );
if ($worker->meadow_user eq $ENV{'USER'}) { # if I'm actually allowed to kill the worker...
warn "GarbageCollector:\tCleaning-up /tmp\n";
$valley->cleanup_left_temp_directory( $worker );
}
}
......
......@@ -255,8 +255,11 @@ sub cleanup_left_temp_directory {
# This guarantees that $meadow is defined.
my $meadow = $self->available_meadow_hash->{$worker->meadow_type};
if ($meadow->config_get('CleanupTempDirectoryKilledWorkers')) {
warn "GarbageCollector:\tCleaning-up /tmp\n";
my $rc = $meadow->run_on_host($worker->meadow_host, $worker->meadow_user, ['rm', '-rf', $worker->temp_directory_name]);
$worker->worker_say(sprintf("Error: could not clean %s's temp directory '%s': %s\n", $worker->meadow_host, $worker->temp_directory_name, $@)) if $rc;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment