Create a separate comprehensive mode

This commit is contained in:
Bradley M. Kuhn 2016-05-02 08:47:22 -07:00
parent cc10317ec7
commit ab33daa5d8

View file

@ -269,23 +269,16 @@ sub RunCentralCommitMode($) {
} }
} }
############################################################################## ##############################################################################
# Main line of script sub RunComprehensiveMode() {
foreach my $commitId (keys %WHITELIST_COMMIT_IDS) {
if (defined $CENTRAL_COMMIT) { my $remainingCount = scalar(keys %childProcesses);
RunCentralCommitMode($CENTRAL_COMMIT); while ($remainingCount >= $FORK_LIMIT) {
} print STDERR "Sleep a bit while $remainingCount children going for these commits ",
join(", ", sort values %childProcesses), "\n" if $VERBOSE;
exit 0; sleep 10;
$remainingCount = scalar(keys %childProcesses);
foreach my $commitId (keys %WHITELIST_COMMIT_IDS) { }
my $remainingCount = scalar(keys %childProcesses); my $forkCount = scalar(keys %childProcesses) + 1;
while ($remainingCount >= $FORK_LIMIT) {
print STDERR "Sleep a bit while $remainingCount children going for these commits ",
join(", ", sort values %childProcesses), "\n" if $VERBOSE;
sleep 10;
$remainingCount = scalar(keys %childProcesses);
}
my $forkCount = scalar(keys %childProcesses) + 1;
my $pid = fork(); my $pid = fork();
die "cannot fork: $!" unless defined $pid; die "cannot fork: $!" unless defined $pid;
if ($pid == 0) { # The new child process is here if ($pid == 0) { # The new child process is here
@ -306,6 +299,15 @@ while (scalar(keys %childProcesses) > 0) {
sleep 10; sleep 10;
} }
##############################################################################
# Main line of script
if (defined $CENTRAL_COMMIT) {
RunCentralCommitMode($CENTRAL_COMMIT);
}
exit 0;
my $startCnt = scalar(keys %WHITELIST_COMMIT_IDS); my $startCnt = scalar(keys %WHITELIST_COMMIT_IDS);
my $doneCnt = scalar(keys %finishedOperations); my $doneCnt = scalar(keys %finishedOperations);
print STDERR "ERROR: all children completed but ", $doneCnt - $startCnt, " not completed\n"; print STDERR "ERROR: all children completed but ", $doneCnt - $startCnt, " not completed\n";