Bug 135466 - ports-mgmt/portupgrade leaves orphaned lock files since ruby 1.8.7p160 upgrade
Summary: ports-mgmt/portupgrade leaves orphaned lock files since ruby 1.8.7p160 upgrade
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ruby (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-11 08:00 UTC by Virgil Champlin
Modified: 2009-10-26 12:58 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Virgil Champlin 2009-06-11 08:00:05 UTC
	Since the ruby-1.8.7.160,1 upgrade, ports-mgmt/portupgrade
	utilities will fail to remove their lock files
	/var/run/pkgdb.db.lock and /var/run/portsdb.lock.  Subsequent
	invocations more than 2 minutes later will display the warning
	"** Stale lock file was found. Removed.". 

	This is caused by the failure of the new version of ruby to run
	the finalizers for the classes PkgDB
	(/usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb - line 106) and
	PortsDB (/usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb - line 156).
	Their sole function is to remove the lock files.

Fix: 

I'm sorry but I know next to nothing about Ruby so this is well
	above me.  One obvious but marginal suggestion is to revert to
	the previous version of lang/ruby18 (ruby-1.8.7p72). This
	assumes it's a new bug in Ruby and needs a followup bug report
	submitted to them.  I would be happy to help but I'm too
	unfamiliar to make this call.  For all I know, it has something
	to do with with a subtlety of Ruby finalizers and it is now
	working correctly.

	Another suggestion is to review the locking strategy in the
	portupgrade suite and eliminate its dependence on finalizers.
	That is their sole purpose for these classes and coming from
	Java[TM], I'm inclined to avoid finalizers.  I would be glad to
	help but I wouldn't let me make the decision.
How-To-Repeat: 
	Any invocation of portupgrade with the current version of
	lang/ruby18 (ruby-1.8.7p160) should leave the aforementioned
	orphaned lock files. The following works well on my systems.

	     sudo portupgrade -f ports-mgmt/portupgrade
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2009-06-11 21:27:46 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sem

Over to maintainer.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2009-07-25 02:49:54 UTC
Responsible Changed
From-To: sem->ruby

sem@ has turned over maintainership of portupgrade to the ruby mailing list.
Comment 3 Stanislav Sedov freebsd_committer freebsd_triage 2009-10-26 12:58:11 UTC
State Changed
From-To: open->closed

Fixed in ruby 1.8.7.160_2.