From a6866b8de8954273505435612b843cf716a097c3 Mon Sep 17 00:00:00 2001 From: Leigh B Stoller Date: Wed, 6 May 2015 16:17:04 -0600 Subject: [PATCH] Bug Fix: Add waitForMount of the group directory too, since it appears to not always be immediately available. Mike says there is a race in mountd. Surprise! --- tbsetup/mkgroup.in | 7 +++++-- tbsetup/mkproj.in | 13 ++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/tbsetup/mkgroup.in b/tbsetup/mkgroup.in index 858f021de..f10a49fcd 100644 --- a/tbsetup/mkgroup.in +++ b/tbsetup/mkgroup.in @@ -228,12 +228,15 @@ if ($WITHZFS) { } # - # There is some lag before the automounter can mount the new - # volume. Lets delay until we can access the project directory. + # There is some lag before the automounter can mount the new volumes. + # Lets delay until we can access the project/group directories. # if (emutil::waitForMount($projdir) < 0) { fatal("Could not access new project directory: $projdir"); } + if (emutil::waitForMount("$GRPROOT/$pid") < 0) { + fatal("Could not access new group directory: $GRPROOT/$pid"); + } } if (!$isnonlocal) { diff --git a/tbsetup/mkproj.in b/tbsetup/mkproj.in index a3dd8ca9e..5b0e8a724 100755 --- a/tbsetup/mkproj.in +++ b/tbsetup/mkproj.in @@ -345,6 +345,9 @@ if (! -e "$PROJROOT/$pid") { fatal("Could not access directory $PROJROOT/$pid"); } } + else { + fatal("Could not access directory $PROJROOT/$pid"); + } } foreach my $dir (@DIRLIST) { if (! -e "$PROJROOT/$pid/$dir") { @@ -353,7 +356,15 @@ foreach my $dir (@DIRLIST) { } if (! -e "$GRPROOT/$pid") { - fatal("Could not access directory $GRPROOT/$pid"); + if ($WITHZFS) { + # Wait for mountd to finish + if (emutil::waitForMount("$GRPROOT/$pid") < 0) { + fatal("Could not access directory $GRPROOT/$pid"); + } + } + else { + fatal("Could not access directory $GRPROOT/$pid"); + } } if ($SCRATCHROOT && ! -e "$SCRATCHROOT/$pid") { -- GitLab