From owner-freebsd-ports@FreeBSD.ORG Wed Jun 17 17:28:45 2009 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E655F106564A for ; Wed, 17 Jun 2009 17:28:45 +0000 (UTC) (envelope-from hiroto.kagotani@gmail.com) Received: from mail-pz0-f171.google.com (mail-pz0-f171.google.com [209.85.222.171]) by mx1.freebsd.org (Postfix) with ESMTP id BBA6B8FC20 for ; Wed, 17 Jun 2009 17:28:45 +0000 (UTC) (envelope-from hiroto.kagotani@gmail.com) Received: by pzk1 with SMTP id 1so486457pzk.3 for ; Wed, 17 Jun 2009 10:28:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=GlxVhSYw1RNwphUY/nQEsnGsPpOVLXEptnOQHkcrvVQ=; b=DffH9b0sMhm7FIMq8EV8k+E//5RQqZFE3S1afkQs2s/KOCXTQ7Ek3HKXoIJAh50C7Q vjlzj7A4fXcXvJMKvH/HOV1pnNuKdhJpS+6gjx4cSOJq8b0QTp2zAVb8V/dwXya9qJyp EQ/YWmNNVmgmPrjheqOH6QIgyTH0Z+WnE+RGk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=hr43+CsDqOBewmLOn+wLw8C8LhMnyPv+JZ2MiiApdsaXyfXBOKEkwn/xTBe29r+mgf s4YRw+1KA9UrXgvt9ftORzfp3bgm9S1faHnLw56VuAJYexRT35PMPj3VCYEp23hlOfn/ YjvnvW2GULh8M/cDrJbRITjtvlybBisvz948M= MIME-Version: 1.0 Received: by 10.142.51.4 with SMTP id y4mr392807wfy.155.1245258456468; Wed, 17 Jun 2009 10:07:36 -0700 (PDT) In-Reply-To: <4A38B47E.1070906@icyb.net.ua> References: <4A38B47E.1070906@icyb.net.ua> Date: Thu, 18 Jun 2009 02:07:36 +0900 Message-ID: From: Hiroto Kagotani To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: FreeBSD Ports Subject: Re: portupgrade/ruby issue? (Stale lock file was found. Removed.) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2009 17:28:46 -0000 2009/6/17 Andriy Gapon : > > After recent massive ports update (I think ruby was touch and probably portupgrade > too) I started getting seemingly sporadic "Stale lock file was found. Removed." > messages. It is probably caused by ruby-1.8.7's bug fogetting to call finalizers. This is filed as Bug #1556 (http://redmine.ruby-lang.org/issues/show/1556 ... japanese page; please translate it ;) Workaround for the case may be using at_exit instead of finalizers. My sample fix is: --- pkgdb.rb.orig 2009-04-14 16:56:38.000000000 +0900 +++ pkgdb.rb 2009-06-18 01:49:19.000000000 +0900 @@ -103,8 +103,8 @@ # end end - def PkgDB.finalizer - Proc.new { + def PkgDB.define_at_exit + at_exit { PkgDBTools.remove_lock(LOCK_FILE) } end @@ -113,7 +113,7 @@ @db = nil @lock_file = Process.euid == 0 ? LOCK_FILE : nil @db_version = DB_VERSION - ObjectSpace.define_finalizer(self, PkgDB.finalizer) + PkgDB.define_at_exit setup(*args) end --- portsdb.rb.orig 2009-04-14 16:56:38.000000000 +0900 +++ portsdb.rb 2009-06-18 01:49:04.000000000 +0900 @@ -153,8 +153,8 @@ end end - def PortsDB.finalizer - Proc.new { + def PortsDB.define_at_exit + at_exit { PkgDBTools.remove_lock(LOCK_FILE) } end @@ -163,7 +163,7 @@ @db = nil @lock_file = Process.euid == 0 ? LOCK_FILE : nil @db_version = DB_VERSION - ObjectSpace.define_finalizer(self, PortsDB.finalizer) + PortsDB.define_at_exit set_ports_dir(alt_ports_dir) set_db_dir(alt_db_dir) set_db_driver(alt_db_driver) -- Hiroto Kagotani