Title: [opsview] [11816] Changed the removal of the /opt/opsview/work/web-cache directory to be in Opsview::Web
Revision
11816
Author
tvoon
Date
2013-03-15 14:36:03 +0000 (Fri, 15 Mar 2013)

Log Message

Changed the removal of the /opt/opsview/work/web-cache directory to be in Opsview::Web
so that it also helps with tests that hang

Modified Paths

Modified: trunk/opsview-web/bin/opsview-web
===================================================================
--- trunk/opsview-web/bin/opsview-web	2013-03-15 14:12:44 UTC (rev 11815)
+++ trunk/opsview-web/bin/opsview-web	2013-03-15 14:36:03 UTC (rev 11816)
@@ -80,10 +80,6 @@
         echo "Already running"
         RETVAL=0
     else
-        # Remove the web-cache because of a bug in Berkeley DB:
-        # http://stackoverflow.com/questions/12400663/berkeley-db-stuck-at-futex-wait-because-of-previous-abnormal-quit-during-c-api
-        rm -r /opt/opsview/work/web-cache 2> /dev/null
-
         # We need to have the -f so that Catalyst will startup Starman instead of the dev server
         args="-f --host $BIND_ADDRESS"
         wrapper=""

Modified: trunk/opsview-web/lib/Opsview/Web.pm
===================================================================
--- trunk/opsview-web/lib/Opsview/Web.pm	2013-03-15 14:12:44 UTC (rev 11815)
+++ trunk/opsview-web/lib/Opsview/Web.pm	2013-03-15 14:36:03 UTC (rev 11816)
@@ -31,6 +31,7 @@
 use Digest::MD5 qw(md5_hex);
 use URI;
 use URI::QueryParam;
+use File::Path qw(remove_tree);
 
 # Uncomment the following two lines if you want to see a stack trace of warn messages that appear
 #use Carp qw(cluck);
@@ -352,6 +353,12 @@
 __PACKAGE__->config->{'Plugin::Static::Simple'}->{ignore_extensions} = [qw/tt/];
 
 # General BerkleyDB cache - used by C::P::Snippets in snmpwalk
+# We need to remove the tree because opsview-web can get stuck starting up
+# We do it here instead of opsview-web because sometimes the automated tests hang
+# There is some issue with BerkeleyDB, but we don't understand what it is.
+# It's acceptable to lose this data over a restart of opsview-web
+# See http://stackoverflow.com/questions/12400663/berkeley-db-stuck-at-futex-wait-because-of-previous-abnormal-quit-during-c-api
+remove_tree( "/opt/opsview/work/web-cache" );
 __PACKAGE__->config->{cache}->{storage}  = "/opt/opsview/work/web-cache";
 __PACKAGE__->config->{cache}->{expires}  = 3600;
 __PACKAGE__->config->{'Plugin::Session'} = {

_______________________________________________
Opsview-checkins mailing list
Opsview-checkins@lists.opsview.org
http://lists.opsview.org/lists/listinfo/opsview-checkins

Reply via email to