Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5CCE788B4 for ; Mon, 5 Sep 2011 17:46:52 +0000 (UTC) Received: (qmail 28051 invoked by uid 500); 5 Sep 2011 17:46:50 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 27981 invoked by uid 500); 5 Sep 2011 17:46:49 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 27973 invoked by uid 99); 5 Sep 2011 17:46:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Sep 2011 17:46:49 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [200.243.80.130] (HELO mail.loop.com.br) (200.243.80.130) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 05 Sep 2011 17:46:42 +0000 Received: (qmail 2761 invoked by uid 64014); 5 Sep 2011 14:46:15 -0300 Received: from 172.17.2.106 (mike@loop.com.br@172.17.2.106) by intranet (envelope-from , uid 64011) with qmail-scanner-2.01st (clamdscan: 0.88/1633. spamassassin: 3.0.3. perlscan: 2.01st. Clear:RC:1(172.17.2.106):. Processed in 0.011311 secs); 05 Sep 2011 17:46:15 -0000 Received: from unknown (HELO ?172.17.2.106?) (mike@loop.com.br@172.17.2.106) by 172.17.3.17 with SMTP; 5 Sep 2011 14:46:15 -0300 Subject: Encountered all_dbs_active with compaction daemon on trunk From: Mike Leddy To: user Date: Mon, 05 Sep 2011 14:46:14 -0300 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.0.2- Content-Transfer-Encoding: 7bit Message-ID: <1315244775.4259.22.camel@mike.loop.com.br> Mime-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Hi, I decided to test out the latest trunk on one of my nodes with some 2,500 databases. On activating the compaction daemon it became apparent that some databases were being opened but not closed. Looking at the debug logs it became clear that when a database did not need to be compacted it was remaining open (confirmed with lsof). I made a small one line patch which seems to have resolved the problem: --- a/src/couchdb/couch_compaction_daemon.erl +++ b/src/couchdb/couch_compaction_daemon.erl @@ -185,6 +185,7 @@ maybe_compact_db(DbName, Config) -> end end; false -> + couch_db:close(Db), maybe_compact_views(DbName, DDocNames, Config) end; _ -> This makes sure that when can_db_compact returns false that couch_db:close is called. [I have to admit it seems strange to me to call couch_db:close in four different places to clean up the the one couch_db:open_int but my erlang coding skills are weak.] Regards, Mike