Index: trunk/Nebulous/lib/Nebulous/Client.pm
===================================================================
--- trunk/Nebulous/lib/Nebulous/Client.pm	(revision 18455)
+++ trunk/Nebulous/lib/Nebulous/Client.pm	(revision 18463)
@@ -1,5 +1,5 @@
 # Copyright (c) 2004-2008  Joshua Hoblitt
 #
-# $Id: Client.pm,v 1.56 2008-07-10 02:38:58 jhoblitt Exp $
+# $Id: Client.pm,v 1.57 2008-07-10 23:21:27 jhoblitt Exp $
 
 package Nebulous::Client;
@@ -171,22 +171,8 @@
     $log->debug( "URI is: $uri" );
 
-    # XXX this is a attempt to work around some sort of nasty NFS bug where
-    # occasionally stat()/open() on a file on an NFS mounted filesystem will
-    # fail EVEN THOU THE FILE ACTUALLY EXISTS.
-    #
-    #  The instance file attempting to be opened should always exist as it was
-    #  created by the Nebulous server.
     my $fh;
-    for (my $i = 0; $i < 10; $i++) {
-        eval {
-            $fh = _open_uri( $uri, '+<' );
-        };
-        if ($@ =~ qr/file doesn't exist/) {
-            $self->set_err($@);
-            sleep 1;
-        } else {
-            last;
-        }
-    }
+    eval {
+        $fh = _open_uri( $uri, '+<' );
+    };
     $log->logdie( $@ ) if $@;
 
Index: trunk/Nebulous/lib/Nebulous/Util.pm
===================================================================
--- trunk/Nebulous/lib/Nebulous/Util.pm	(revision 18455)
+++ trunk/Nebulous/lib/Nebulous/Util.pm	(revision 18463)
@@ -1,5 +1,5 @@
 # Copyright (c) 2004  Joshua Hoblitt
 #
-# $Id: Util.pm,v 1.12 2008-05-29 03:59:30 jhoblitt Exp $
+# $Id: Util.pm,v 1.13 2008-07-10 23:21:27 jhoblitt Exp $
 
 package Nebulous::Util;
@@ -70,9 +70,29 @@
     my ( $path, $flags ) = @_;
 
-    die "can't open file $path: file doesn't exist" 
-        unless -e $path;
-    CORE::open( my $fh, $flags, $path )
-        or die "can't open file $path: $!";
-
+    # XXX this is a attempt to work around some sort of nasty NFS bug where
+    # occasionally stat()/open() on a file on an NFS mounted filesystem will
+    # fail EVEN THOU THE FILE ACTUALLY EXISTS.
+    #
+    # The instance file attempting to be opened should always exist as it was
+    # created by the Nebulous server.
+    my $fh;
+    for (my $i = 0; $i < 60; $i++) {
+        eval {
+            die "can't open file $path: file doesn't exist" 
+                unless -e $path;
+            CORE::open($fh, $flags, $path)
+                or die "can't open file $path: $!";
+        };
+        if ($@ =~ qr/file doesn't exist/) {
+            sleep 1;
+            next;
+        } 
+        if ($@) {
+            die $@;
+        }
+
+        last;
+    }
+    
     return $fh;
 }
