[LON-CAPA-cvs] cvs: rat / lonambiguous.pm lonpageflip.pm loncom loncapa_apache.conf loncom/interface groupsort.pm lonindexer.pm lonnavmaps.pm lonsearchcat.pm

www lon-capa-cvs@mail.lon-capa.org
Tue, 14 Jan 2003 18:47:50 -0000


www		Tue Jan 14 13:47:50 2003 EDT

  Modified files:              
    /loncom	loncapa_apache.conf 
    /loncom/interface	groupsort.pm lonindexer.pm lonnavmaps.pm 
                     	lonsearchcat.pm 
    /rat	lonambiguous.pm lonpageflip.pm 
  Log:
  Attempt to better catch and log untied hashes by usage of cleanup handlers.
  
  
Index: loncom/loncapa_apache.conf
diff -u loncom/loncapa_apache.conf:1.29 loncom/loncapa_apache.conf:1.30
--- loncom/loncapa_apache.conf:1.29	Thu Jan  9 17:04:28 2003
+++ loncom/loncapa_apache.conf	Tue Jan 14 13:47:50 2003
@@ -1,7 +1,7 @@
 ##
 ## loncapa_apache.conf -- Apache HTTP LON-CAPA configuration file
 ##
-## $Id: loncapa_apache.conf,v 1.29 2003/01/09 22:04:28 www Exp $
+## $Id: loncapa_apache.conf,v 1.30 2003/01/14 18:47:50 www Exp $
 ##
 ## 1/11/2002 - Scott Harrison
 ## 2/19/2002 - Scott Harrison
@@ -269,6 +269,7 @@
 PerlAccessHandler       Apache::lonacc
 SetHandler perl-script
 PerlHandler Apache::lonpageflip
+PerlCleanupHandler Apache::lonpageflip::cleanup
 ErrorDocument     406 /adm/roles
 ErrorDocument     403 /adm/login
 ErrorDocument	  500 /adm/errorhandler
@@ -278,6 +279,7 @@
 PerlAccessHandler       Apache::lonacc
 SetHandler perl-script
 PerlHandler Apache::lonambiguous
+PerlCleanupHandler Apache::lonambiguous::cleanup
 ErrorDocument     403 /adm/login
 ErrorDocument	  500 /adm/errorhandler
 </Location>
@@ -539,6 +541,7 @@
 PerlAccessHandler       Apache::lonacc
 SetHandler perl-script
 PerlHandler Apache::lonnavmaps
+PerlCleanupHandler Apache::lonnavmaps::cleanup
 ErrorDocument     403 /adm/login
 ErrorDocument     406 /adm/roles
 ErrorDocument	  500 /adm/errorhandler
Index: loncom/interface/groupsort.pm
diff -u loncom/interface/groupsort.pm:1.17 loncom/interface/groupsort.pm:1.18
--- loncom/interface/groupsort.pm:1.17	Thu Jan  9 17:04:28 2003
+++ loncom/interface/groupsort.pm	Tue Jan 14 13:47:50 2003
@@ -2,7 +2,7 @@
 # The LON-CAPA group sort handler
 # Allows for sorting prior to import into RAT.
 #
-# $Id: groupsort.pm,v 1.17 2003/01/09 22:04:28 www Exp $
+# $Id: groupsort.pm,v 1.18 2003/01/14 18:47:50 www Exp $
 # 
 # Copyright Michigan State University Board of Trustees
 #
@@ -45,7 +45,12 @@
 my $iconpath; # variable to be accessible to multiple subroutines
 
 sub cleanup {
-   untie(%hash) if (tied(%hash));
+    if (tied(%hash)){
+	&Apache::lonnet::logthis('Cleanup groupsort: hash');
+        unless (untie(%hash)) {
+	    &Apache::lonnet::logthis('Failed cleanup groupsort: hash');
+        }
+    }
 }
 
 # ---------------------------------------------------------------- Main Handler
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.54 loncom/interface/lonindexer.pm:1.55
--- loncom/interface/lonindexer.pm:1.54	Thu Jan  9 17:04:28 2003
+++ loncom/interface/lonindexer.pm	Tue Jan 14 13:47:50 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.54 2003/01/09 22:04:28 www Exp $
+# $Id: lonindexer.pm,v 1.55 2003/01/14 18:47:50 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -920,7 +920,12 @@
 1;
 
 sub cleanup {
-    untie(%hash) if (tied(%hash));
+    if (tied(%hash)){
+	&Apache::lonnet::logthis('Cleanup indexer: hash');
+        unless (untie(%hash)) {
+	    &Apache::lonnet::logthis('Failed cleanup indexer: hash');
+        }
+    }
 }
 
 =head1 NAME
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.129 loncom/interface/lonnavmaps.pm:1.130
--- loncom/interface/lonnavmaps.pm:1.129	Tue Jan 14 12:19:27 2003
+++ loncom/interface/lonnavmaps.pm	Tue Jan 14 13:47:50 2003
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.129 2003/01/14 17:19:27 bowersj2 Exp $
+# $Id: lonnavmaps.pm,v 1.130 2003/01/14 18:47:50 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -46,6 +46,24 @@
 use Apache::loncommon();
 use POSIX qw (floor strftime);
 
+my %navmaphash;
+my %parmhash;
+
+sub cleanup {
+    if (tied(%navmaphash)){
+	&Apache::lonnet::logthis('Cleanup navmaps: navmaphash');
+        unless (untie(%navmaphash)) {
+	    &Apache::lonnet::logthis('Failed cleanup navmaps: navmaphash');
+        }
+    }
+    if (tied(%parmhash)){
+	&Apache::lonnet::logthis('Cleanup navmaps: parmhash');
+        unless (untie(%parmhash)) {
+	    &Apache::lonnet::logthis('Failed cleanup navmaps: parmhash');
+        }
+    }
+}
+
 sub handler {
     my $r = shift;
     real_handler($r);
@@ -985,13 +1003,12 @@
     $self->{NETWORK_FAILURE} = 0;
 
     # tie the nav hash
-    my %navmaphash;
+
     if (!(tie(%navmaphash, 'GDBM_File', $self->{NAV_HASH_FILE},
               &GDBM_READER(), 0640))) {
         return undef;
     }
     
-    my %parmhash;
     if (!(tie(%parmhash, 'GDBM_File', $self->{PARM_HASH_FILE},
               &GDBM_READER(), 0640)))
     {
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.162 loncom/interface/lonsearchcat.pm:1.163
--- loncom/interface/lonsearchcat.pm:1.162	Mon Jan  6 08:54:25 2003
+++ loncom/interface/lonsearchcat.pm	Tue Jan 14 13:47:50 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Search Catalog
 #
-# $Id: lonsearchcat.pm,v 1.162 2003/01/06 13:54:25 www Exp $
+# $Id: lonsearchcat.pm,v 1.163 2003/01/14 18:47:50 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2963,7 +2963,12 @@
 1;
 
 sub cleanup {
-    untie %groupsearch_db if (tied(%groupsearch_db));
+    if (tied(%groupsearch_db)) {
+	&Apache::lonnet::logthis('Cleanup searchcat: groupsearch_db');
+        unless (untie(%groupsearch_db)) {
+	  &Apache::lonnet::logthis('Failed cleanup searchcat: groupsearch_db');
+        }
+    }
     &Apache::lonmysql::disconnect_from_db();
 }
 
Index: rat/lonambiguous.pm
diff -u rat/lonambiguous.pm:1.7 rat/lonambiguous.pm:1.8
--- rat/lonambiguous.pm:1.7	Wed Nov  6 17:51:51 2002
+++ rat/lonambiguous.pm	Tue Jan 14 13:47:50 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to resolve ambiguous file locations
 #
-# $Id: lonambiguous.pm,v 1.7 2002/11/06 22:51:51 albertel Exp $
+# $Id: lonambiguous.pm,v 1.8 2003/01/14 18:47:50 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -38,6 +38,16 @@
 use Apache::Constants qw(:common REDIRECT);
 use GDBM_File;
 
+my %bighash;
+
+sub cleanup {
+    if (tied(%bighash)){
+	&Apache::lonnet::logthis('Cleanup ambiguous: bighash');
+        unless (untie(%bighash)) {
+	    &Apache::lonnet::logthis('Failed cleanup ambiguous: bighash');
+        }
+    }
+}
 
 # ----------------------------------------------------------- Could not resolve
 
@@ -63,9 +73,7 @@
    }
 
 # ---------------------------------------------------------- Is this selecting?
-   
-   my %bighash;
-
+ 
    if ($ENV{'form.selecturl'}) {
        my $envkey;
        if (tie(%bighash,'GDBM_File',$ENV{'request.course.fn'}.'.db',
Index: rat/lonpageflip.pm
diff -u rat/lonpageflip.pm:1.33 rat/lonpageflip.pm:1.34
--- rat/lonpageflip.pm:1.33	Fri Dec  6 09:06:53 2002
+++ rat/lonpageflip.pm	Tue Jan 14 13:47:50 2003
@@ -2,7 +2,7 @@
 #
 # Page flip handler
 #
-# $Id: lonpageflip.pm,v 1.33 2002/12/06 14:06:53 www Exp $
+# $Id: lonpageflip.pm,v 1.34 2003/01/14 18:47:50 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -49,6 +49,15 @@
 # ========================================================== Module Global Hash
   
 my %hash;
+
+sub cleanup {
+    if (tied(%hash)){
+	&Apache::lonnet::logthis('Cleanup pageflip: hash');
+        unless (untie(%hash)) {
+	    &Apache::lonnet::logthis('Failed cleanup pageflip: hash');
+        }
+    }
+}
 
 sub addrid {
     my ($current,$new,$condid)=@_;