Commit 8c88eeab authored by Jessica Severin's avatar Jessica Severin
Browse files

removed analysisStats synch that always happened when worker is created (not needed)

added check/set of status to 'SYNCHING' right before the synch procedure
so as to prevent multiple workers from simultaneously trying to synch at the same time.
parent b005b004
......@@ -114,7 +114,6 @@ sub create_new_worker {
return undef unless($analysisStats);
......@@ -262,6 +261,9 @@ sub synchronize_AnalysisStats {
return $analysisStats unless($analysisStats);
return $analysisStats unless($analysisStats->analysis_id);
return $analysisStats if($analysisStats->status eq 'SYNCHING');
......@@ -433,14 +435,14 @@ sub get_num_needed_workers {
if(($analysis_stats->hive_capacity<=0) or ($thisLoad < $availableLoad)) {
$numWorkers += $analysis_stats->num_required_workers;
$availableLoad -= $thisLoad;
printf("%5d (%1.3f) ", $numWorkers, $availableLoad);
printf(" %5d workers (%1.3f remaining-hive-load)\n", $numWorkers, $availableLoad);
} else {
my $workerCount = POSIX::ceil($availableLoad * $analysis_stats->hive_capacity);
$numWorkers += $workerCount;
$availableLoad -= $workerCount * (1/$analysis_stats->hive_capacity);
printf("%5d (%1.3f) use only %3d ", $numWorkers, $availableLoad, $workerCount);
printf(" %5d workers (%1.3f remaining-hive-load) use only %3d workers\n", $numWorkers, $availableLoad, $workerCount);
last if($availableLoad <= 0.0);
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