You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2009/06/30 19:02:24 UTC

svn commit: r789829 - in /couchdb/trunk: share/www/script/test/stats.js src/couchdb/couch_server_sup.erl

Author: kocolosk
Date: Tue Jun 30 17:02:24 2009
New Revision: 789829

URL: http://svn.apache.org/viewvc?rev=789829&view=rev
Log:
reset stats on POST /_restart and correct open_databases test.  Closes COUCHDB-398

I rearranged the shutdown order from what was committed in the 0.9.x branch so
that the stats collector is still up when couch_server shuts down.  This way the
messages to decrement the number of open_databases during the shutdown don't
fail with a badarg. The badarg is silently ignored in 0.9.x, but here we pattern
match with a true so we end up with lots of error reports.

You may see some spurious erlang error reports when running the test suite on
an SMP emulator, due to the use of public ets tables in the stats collector API.

Modified:
    couchdb/trunk/share/www/script/test/stats.js
    couchdb/trunk/src/couchdb/couch_server_sup.erl

Modified: couchdb/trunk/share/www/script/test/stats.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/stats.js?rev=789829&r1=789828&r2=789829&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/stats.js (original)
+++ couchdb/trunk/share/www/script/test/stats.js Tue Jun 30 17:02:24 2009
@@ -64,7 +64,7 @@
             db.createDb();
           }
 
-          var open_databases = requestStatsTest("couchdb", "open_databases").max;
+          var open_databases = requestStatsTest("couchdb", "open_databases").current;
           T(open_databases > 0 && max >= open_databases, name);
 
           for(var i=0; i<max+1; i++) {

Modified: couchdb/trunk/src/couchdb/couch_server_sup.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_server_sup.erl?rev=789829&r1=789828&r2=789829&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_server_sup.erl (original)
+++ couchdb/trunk/src/couchdb/couch_server_sup.erl Tue Jun 30 17:02:24 2009
@@ -32,10 +32,12 @@
     end.
 
 restart_core_server() ->
-    supervisor:terminate_child(couch_secondary_services, couch_server),
     supervisor:terminate_child(couch_primary_services, couch_server),
+    supervisor:terminate_child(couch_secondary_services, stats_aggregator),
+    supervisor:terminate_child(couch_secondary_services, stats_collector),
     supervisor:restart_child(couch_primary_services, couch_server),
-    supervisor:restart_child(couch_secondary_services, couch_server).
+    supervisor:restart_child(couch_secondary_services, stats_collector),
+    supervisor:restart_child(couch_secondary_services, stats_aggregator).
 
 couch_config_start_link_wrapper(IniFiles, FirstConfigPid) ->
     case is_process_alive(FirstConfigPid) of