From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 10BD3431FC4 for ; Thu, 14 Nov 2013 06:09:56 -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 oUcqTd625Y0W for ; Thu, 14 Nov 2013 06:09:48 -0800 (PST) Received: from mail-bk0-f51.google.com (mail-bk0-f51.google.com [209.85.214.51]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 1E051431FB6 for ; Thu, 14 Nov 2013 06:09:47 -0800 (PST) Received: by mail-bk0-f51.google.com with SMTP id my10so407224bkb.24 for ; Thu, 14 Nov 2013 06:09:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-type; bh=+9slkSVoKsNFbx2kg8ngGOHAODWk9nzr9Rls18y1Ee4=; b=l24YmJkogebpriTGUK2RczN8ZBghGmto+cCqlU40d95jt/iMrzsHd8sqgmMExoQmrh dG2uOuOceB/3upWu0VMOzmlV7rjdvruJYLTJWtUcn6NLfOv0+4q3XMEwmtBqsEh8ll2t Vsdf3rMmTMiEeNBR+AjyTszyWjHpdqiiWh6mpeRzpD0wS5+BevRifwjs35S68+2vcNIo MWtwMklhILbOg2vz6l5kcCUpl0Eipe4FomlDix2175qiJacDbv6pqnS/50P1DDaSAHEw UNPqhXSPwUUZlASkTuaY1+8vFDhYtKUQS7a5E/3X1CNqFCootyFpYPyZd925xDdjfo6E RIMA== X-Gm-Message-State: ALoCoQlbFLnPJDOyMJE5lR114RFoyEHrcG8yU9tXQUCzuawoiXrKDwI3p3MNBLgjdIx/6NRprwzU X-Received: by 10.204.68.142 with SMTP id v14mr1341100bki.18.1384437764452; Thu, 14 Nov 2013 06:02:44 -0800 (PST) Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3]) by mx.google.com with ESMTPSA id pn6sm3481861bkb.14.2013.11.14.06.02.42 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Thu, 14 Nov 2013 06:02:43 -0800 (PST) From: Jani Nikula To: Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [PATCH v2 4/5] compact: unconditionally attempt to remove old wip database compact directory In-Reply-To: <1384362167-12740-5-git-send-email-tomi.ollila@iki.fi> References: <1384362167-12740-1-git-send-email-tomi.ollila@iki.fi> <1384362167-12740-5-git-send-email-tomi.ollila@iki.fi> User-Agent: Notmuch/0.16+115~gd647c65 (http://notmuchmail.org) Emacs/23.2.1 (x86_64-pc-linux-gnu) Date: Thu, 14 Nov 2013 15:02:27 +0100 Message-ID: <877gcbnkss.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: tomi.ollila@iki.fi 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: Thu, 14 Nov 2013 14:09:56 -0000 On Wed, 13 Nov 2013, Tomi Ollila wrote: > In case previous notmuch compact has been interrupted there is old > work-in-progress database compact directory partially filled. Remove > it just before starting to fill the directory with new files. > --- > lib/database.cc | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/lib/database.cc b/lib/database.cc > index ee09c5e..4b5ac64 100644 > --- a/lib/database.cc > +++ b/lib/database.cc > @@ -920,6 +920,11 @@ notmuch_database_compact (const char *path, > goto DONE; > } > > + // Unconditionally attempt to remove old work-in-progress database (if any). > + // This is "protected" by database lock. If this fails due to write errors > + // (etc), the following code will fail and provide error message. > + (void) rmtree (compact_xapian_path); I thought we avoid using // comments. Otherwise LGTM. > + > try { > NotmuchCompactor compactor (status_cb, closure); > > -- > 1.8.3.1 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch