--- loncom/lonnet/perl/lonnet.pm 2004/09/27 19:00:16 1.548 +++ loncom/lonnet/perl/lonnet.pm 2004/10/05 11:24:34 1.549 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.548 2004/09/27 19:00:16 albertel Exp $ +# $Id: lonnet.pm,v 1.549 2004/10/05 11:24:34 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -116,6 +116,18 @@ sub logperm { sub subreply { my ($cmd,$server)=@_; my $peerfile="$perlvar{'lonSockDir'}/$server"; + # + # With loncnew process trimming, there's a timing hole between lonc server + # process exit and the master server picking up the listen on the AF_UNIX + # socket. In that time interval, a lock file will exist: + + my $lockfile=$peerfile.".lock"; + while (-e $lockfile) { # Need to wait for the lockfile to disappear. + sleep(1); + } + # At this point, either a loncnew parent is listening or an old lonc + # or loncnew child is listening so we can connect. + # my $client=IO::Socket::UNIX->new(Peer =>"$peerfile", Type => SOCK_STREAM, Timeout => 10)