From: Austin Clements Date: Wed, 29 Feb 2012 15:48:33 +0000 (+1900) Subject: Re: [PATCH] Actually close the xapian database in notmuch_database_close X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=99e7af059f0d9e6e65d8439613afd71d476d2462;p=notmuch-archives.git Re: [PATCH] Actually close the xapian database in notmuch_database_close --- diff --git a/95/32ac9674d72c85d89814d287e0dcfd66c303fc b/95/32ac9674d72c85d89814d287e0dcfd66c303fc new file mode 100644 index 000000000..d14c5429f --- /dev/null +++ b/95/32ac9674d72c85d89814d287e0dcfd66c303fc @@ -0,0 +1,116 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 440F8431E64 + for ; Wed, 29 Feb 2012 07:48:38 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 1e23ME085oqC for ; + Wed, 29 Feb 2012 07:48:37 -0800 (PST) +Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU + [18.7.68.35]) + by olra.theworths.org (Postfix) with ESMTP id 96A55429E25 + for ; Wed, 29 Feb 2012 07:48:37 -0800 (PST) +X-AuditID: 12074423-b7f9c6d0000008c3-13-4f4e48d4cb98 +Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) + by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP + id 57.B3.02243.4D84E4F4; Wed, 29 Feb 2012 10:48:36 -0500 (EST) +Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) + by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q1TFmZ36012392; + Wed, 29 Feb 2012 10:48:35 -0500 +Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q1TFmXow002648 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Wed, 29 Feb 2012 10:48:35 -0500 (EST) +Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) + (envelope-from ) + id 1S2llZ-000861-Nd; Wed, 29 Feb 2012 10:48:33 -0500 +Date: Wed, 29 Feb 2012 10:48:33 -0500 +From: Austin Clements +To: Justus Winter <4winter@informatik.uni-hamburg.de>, + Olly Betts +Subject: Re: [PATCH] Actually close the xapian database in + notmuch_database_close +Message-ID: <20120229154833.GB772@mit.edu> +References: + <1330507157-22859-1-git-send-email-4winter@informatik.uni-hamburg.de> + <1330507157-22859-2-git-send-email-4winter@informatik.uni-hamburg.de> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: + <1330507157-22859-2-git-send-email-4winter@informatik.uni-hamburg.de> +User-Agent: Mutt/1.5.21 (2010-09-15) +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFupnleLIzCtJLcpLzFFi42IR4hTV1r3i4edvcPeWoMXs1h9MFtdvzmS2 + uL/8PasDs8fE86fZPJ6tusXssW7nH/YA5igum5TUnMyy1CJ9uwSujGszdrEVvOKsuDDzPlsD + 4zP2LkZODgkBE4lj/9YxQ9hiEhfurWfrYuTiEBLYxyixcsExdghnA6NEw9zDTBDOSSaJfZ03 + mSGcJYwS6xeeYwHpZxFQldhwbhmYzSagIbFt/3JGEFtEIEZiz8o3rCA2s4C0xLffzUwgtrBA + sMSpyafZQGxeAS2J63O2QG2YySjRf+YwC0RCUOLkzCcsEM1aEjf+vQQq4gAbtPwfB0iYUyBI + YvHV/WAlogIqElNObmObwCg0C0n3LCTdsxC6FzAyr2KUTcmt0s1NzMwpTk3WLU5OzMtLLdI1 + 08vNLNFLTSndxAgKd3YX5R2Mfw4qHWIU4GBU4uGV5Pf1F2JNLCuuzD3EKMnBpCTKe9Hdz1+I + Lyk/pTIjsTgjvqg0J7X4EKMEB7OSCO9bKaAcb0piZVVqUT5MSpqDRUmcV0PrnZ+QQHpiSWp2 + ampBahFMVoaDQ0mC1w8Y10KCRanpqRVpmTklCGkmDk6Q4TxAw++DLOYtLkjMLc5Mh8ifYlSU + Euf1AWkWAElklObB9cLS0StGcaBXhHl/grTzAFMZXPcroMFMQIMDOL1BBpckIqSkGhi3Orkf + WvM5d4LKWi2eXevLYn+em1s1J3qGW4mse7XLAmOH4l+MagzMChy8Dy78Fl1gJrLu0v8jS79P + LdSUra67F7tf+ZFqYERpUfIFx5NVs1YxlD+svHrc4NY9id+Ch9obNzQnu37NNPsmMSHk7MlO + GQUxM6UvmZc+Ob0p/2+uoakltdQr/pASS3FGoqEWc1FxIgCy3e1aIgMAAA== +Cc: notmuch@notmuchmail.org +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 29 Feb 2012 15:48:38 -0000 + +Quoth Justus Winter on Feb 29 at 10:19 am: +> Formerly the xapian database object was deleted and closed in its +> destructor once the object was garbage collected. Explicitly call +> close() so that the database and the associated lock is released +> immediately. + +Interesting. Is this a bug in Xapian? According to the docs, +~Database is supposed to close the database (if there are no other +copies, which there shouldn't be), so this should be redundant with +the delete notmuch->xapian_db a few lines down, but your experience +obviously suggests that it isn't and I can't find the code path in +Xapian that would close it in the destructor. + +Olly? + +> Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de> +> --- +> lib/database.cc | 4 ++++ +> 1 files changed, 4 insertions(+), 0 deletions(-) +> +> diff --git a/lib/database.cc b/lib/database.cc +> index 5efa85e..79cf375 100644 +> --- a/lib/database.cc +> +++ b/lib/database.cc +> @@ -726,6 +726,10 @@ notmuch_database_close (notmuch_database_t *notmuch) +> } +> } +> +> + if (notmuch->xapian_db != NULL) { +> + notmuch->xapian_db->close(); +> + } +> + +> delete notmuch->term_gen; +> delete notmuch->query_parser; +> delete notmuch->xapian_db;