Commit 2f592758 authored by Mike Hibler's avatar Mike Hibler

Bug Fix: fix a race that Kirk discovered.

Due to improper plumbing of the NOSHAREDFS attribute, all nodes were trying
to create the shared logging dir. The race was between checking for the
existence of the directory and trying to create it.
parent 9cbfa126
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2011 University of Utah and the Flux Group.
* Copyright (c) 2000-2012 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -355,10 +355,10 @@ exec_linktest(char *args, int buflen) {
int i,res;
/*
* Set up arguments for execv call by parsing contents
* of the event string.
* Set up arguments for execv call. First add fixed arguments,
* then parse the contents of the event string. Thus event
* arguments can override the fixed args.
*/
word = strtok(args," \t");
i=1;
snprintf(swapperarg, sizeof(swapperarg), "SWAPPER=%s", swapper);
argv[i++] = swapperarg;
......@@ -369,6 +369,8 @@ exec_linktest(char *args, int buflen) {
"SHAREDDIR=0 LOGDIR=%s", nodelocal_dir);
argv[i++] = logdirarg;
}
word = strtok(args," \t");
do {
argv[i++] = word;
} while ((word = strtok(NULL," \t")) && (i<MAX_ARGS));
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# All rights reserved.
#
use strict;
......@@ -266,6 +266,17 @@ $args .= " DEBUG=$debug"
$args .= " REPORTONLY=1"
if ($reportonly);
#
# All nodes in the experiment need to agree on local logging or not
# so we force it from here. We don't want clients using heuristics to
# decide this.
#
if ($nodelogdir) {
$args .= " SHAREDDIR=0 LOGDIR=$nodelogdir";
} else {
$args .= " SHAREDDIR=1";
}
#
# Remain compatible with older linktests. This will turn off the ARP
# test and force an otherwise pointless barrier synch.
......@@ -417,7 +428,7 @@ sub getdata($) {
my @dir_contents;
opendir(DIR, "$tmpdir") ||
die("*** $0:\n".
" Cannot open $tmpdir\n");
" Cannot open tmp results dir $tmpdir\n");
my @nodes = grep(/^[-\w]+$/, readdir(DIR));
closedir(DIR);
foreach my $node (@nodes) {
......@@ -425,9 +436,13 @@ sub getdata($) {
$node = $1;
}
my $nodedir = "$tmpdir/$node/$datadir";
opendir(DIR, $nodedir) ||
die("*** $0:\n".
" Cannot open $nodedir\n");
if (!opendir(DIR, $nodedir)) {
# do not even complain about delay nodes
if ($node !~ /^tbs?delay/) {
print "*** Cannot find results for $node, ignoring...\n";
}
next;
}
my @files = grep(/\.fatal$|\.error$/, readdir(DIR));
closedir(DIR);
foreach my $file (@files) {
......@@ -457,7 +472,7 @@ sub analyze($) {
my @dir_contents;
opendir(DIR, $linktest_path) ||
die("*** $0:\n".
" Cannot open $linktest_path\n");
" Cannot open results dir $linktest_path\n");
@dir_contents = grep(/\.fatal$|\.error$/, readdir(DIR));
closedir(DIR);
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2005, 2008, 2010 University of Utah and the Flux Group.
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -85,9 +85,6 @@ print("Starting linktest daemon\n");
my $server = getlocalevserver();
my $args = "-s $server -l $logfile -i $pidfile -k $keyfile -u $swapper";
if (FSRVTYPE() eq "LOCAL") {
$args .= " -N $LOGDIR";
}
system("linktest -e $pid/$eid $args");
exit($? >> 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