[LON-CAPA-cvs] cvs: loncom / lonc /lonnet/perl lonnet.pm

www lon-capa-cvs@mail.lon-capa.org
Thu, 05 Dec 2002 19:53:19 -0000


www		Thu Dec  5 14:53:19 2002 EDT

  Modified files:              
    /loncom	lonc 
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  Bug #885
  lonnet did not generate unique buffer filenames when updating both the
  resource and the meta-file, following removal of sleep commands. Added
  PID and $dumpcount to buffer file name.
  
  Also added "sort" to buffer flushing when machine comes online again, so
  that definitely time-order of commands gets preserved.
  
  
Index: loncom/lonc
diff -u loncom/lonc:1.43 loncom/lonc:1.44
--- loncom/lonc:1.43	Wed Oct 30 09:50:04 2002
+++ loncom/lonc	Thu Dec  5 14:53:19 2002
@@ -5,7 +5,7 @@
 # provides persistent TCP connections to the other servers in the network
 # through multiplexed domain sockets
 #
-# $Id: lonc,v 1.43 2002/10/30 14:50:04 www Exp $
+# $Id: lonc,v 1.44 2002/12/05 19:53:19 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -259,7 +259,7 @@
     @allbuffered=grep /\.$conserver$/, readdir DIRHANDLE;
     closedir(DIRHANDLE);
     my $dfname;
-    foreach (@allbuffered) {
+    foreach (sort @allbuffered) {
         &status("Sending delayed: $_");
         $dfname="$path/$_";
         if($DEBUG) { &logthis('Sending '.$dfname); }
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.304 loncom/lonnet/perl/lonnet.pm:1.305
--- loncom/lonnet/perl/lonnet.pm:1.304	Wed Dec  4 10:23:39 2002
+++ loncom/lonnet/perl/lonnet.pm	Thu Dec  5 14:53:19 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.304 2002/12/04 15:23:39 www Exp $
+# $Id: lonnet.pm,v 1.305 2002/12/05 19:53:19 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -202,6 +202,7 @@
                " Critical message to unknown server ($server)</font>");
         return 'no_such_host';
     }
+    sleep 2;
     my $answer=reply($cmd,$server);
     if ($answer eq 'con_lost') {
         my $pingreply=reply('ping',$server);
@@ -215,7 +216,8 @@
             $middlename=substr($middlename,0,16);
             $middlename=~s/\W//g;
             my $dfilename=
-             "$perlvar{'lonSockDir'}/delayed/$now.$middlename.$server";
+      "$perlvar{'lonSockDir'}/delayed/$now.$dumpcount.$$.$middlename.$server";
+            $dumpcount++;
             {
              my $dfh;
              if ($dfh=Apache::File->new(">$dfilename")) {