From owner-freebsd-ports@FreeBSD.ORG Wed Dec 12 15:30:10 2012 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05231FF8 for ; Wed, 12 Dec 2012 15:30:10 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 779AC8FC08 for ; Wed, 12 Dec 2012 15:30:09 +0000 (UTC) Received: by mail-ee0-f54.google.com with SMTP id c13so567990eek.13 for ; Wed, 12 Dec 2012 07:30:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=dDQKhvH29F9ABIt2RPsXHX7vOiP48hKO42OcgIeWL4w=; b=F6EZAhvfTa5jRSP48xgragEEIWbTSpuhqcP3hhsb4rBUlJ24PyjNiOIkSnpU4b17i7 bzxputXiK2tv1B/9KjTKPJR6HFinP60lPeLe4k2EkJ+sntJv4wEdHluPsKNQbZWm3o/9 03tJbA5Ap9Ea58JWxeHcX1vEG4rtf47nyrQwdrd6Vf+fM2WgF8QkQ0Lz1m//kIC1PHy7 DII6y8g52S8UzWwQRtSNFnLCvt9pE8SEfyL14nrT9+5Lc00qLTuifa8QK6PKj7BdbeOV 84281C2hZyD1loFzVtzcgBBB5mAHHsD1njM2gPBEk+SsTmQPW6sAxz1Pkq44otk8yisV mlVg== Received: by 10.14.194.195 with SMTP id m43mr3674456een.44.1355326208265; Wed, 12 Dec 2012 07:30:08 -0800 (PST) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPS id z8sm56562518eeo.11.2012.12.12.07.30.07 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Dec 2012 07:30:07 -0800 (PST) Sender: Baptiste Daroussin Date: Wed, 12 Dec 2012 16:30:05 +0100 From: Baptiste Daroussin To: Jeremy Chadwick Subject: Re: pkgng: sqlite: database is locked Message-ID: <20121212153005.GG68036@ithaqua.etoilebsd.net> References: <20121212145357.GA49439@icarus.home.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3xoW37o/FfUZJwQG" Content-Disposition: inline In-Reply-To: <20121212145357.GA49439@icarus.home.lan> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Mathias.Picker@virtual-earth.de, freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 15:30:10 -0000 --3xoW37o/FfUZJwQG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 12, 2012 at 06:53:57AM -0800, Jeremy Chadwick wrote: > (Please keep me CC'd as I'm not subscribed to the list) >=20 >=20 > > =3D=3D=3D> Registering installation for MuSE-0.9.2_14 > > Installing MuSE-0.9.2_14... done > > pkg: sqlite: database is locked > >=20 > > which results in muse not being registered in the pkg database... >=20 > This worries me. It appears to indicate that the installation of the > package (i.e. sticking files into /usr/local) happens first, followed by > an attempted exclusive lock of the pkg sqlite DB, which then failed -- > thus leaving files laying around in /usr/local. >=20 > If that is the case (and boy do I hope it isn't) then that logic is 100% > backwards. The DB exlock should happen first, and if the DB exlock > fails[1] then things should abort. Otherwise you'll end up with files > installed on your filesystem which aren't registered in the pkg DB, and > that is unacceptable. >=20 pkg install and pkg add doesn't do that at all. Just pkg2ng and installing from ports uses pkg register which does that, exactly the same way pkg_install does, pkg register knows how to do the cle= an way, just the ports tree doesn't know yet how to do it, I have patched for = that unfortunatly it breaks compatibility with pkg_install (the solution is to u= se a stage directory inside the ports tree) If you are worried by this, do not ever have a look at how the pkg_install = works :) > This also worries me: >=20 > > ... This persists between reboots, and for fresh pkg runs.=20 >=20 > What kind of locking mechanism is being used here? flock(2) LOCK_EX > would not survive a reboot, but a filesystem-based dotlock would. It is the sqlite native lock system which is a flock so it should not survi= ve the reboot >=20 > This really needs investigation and not be swept under the rug. And > please don't tell me "you have the source, go look at it" -- I would > much rather the authors who are familiar with the code look at it. :-) >=20 > [1]: I don't advocate that the locking mechanism should block > indefinitely, but there should be some kind of retry attempt at a > specific interval (i.e. try 5 times, with 1 second delays) before giving > up -- and something on-screen should be printed/shown every time an > attempt to lock is made. Maybe that already happens, I don't know, I > don't use pkg. This is already in, and we have a lot of work for a finer grain locking sys= tem. Anyway the reported issue is really strange and need way more details to be= able to be investigated. regards, Bapt --3xoW37o/FfUZJwQG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDIov0ACgkQ8kTtMUmk6EzU5ACfbRcT4ZRkXF4Zv23BIDdbKv2A lA4An1aewaOldDm6m1O4VpIFZXnBo7wD =Fu3w -----END PGP SIGNATURE----- --3xoW37o/FfUZJwQG--