[DRE-maint] Bug#862409: Concurrent gem2deb processes fail updating packages cache

Dominic Cleal dominic at cleal.org
Fri May 12 12:30:52 UTC 2017


Package: gem2deb
Version: 0.30.1
Tags: patch

When two gem2deb processes are executed by the same user concurrently
(e.g. in a CI system building many packages), the Gem2Deb::DhMakeRuby
class can raise an error when updating its gem_to_package_data cache:

-- Creating Debian source package from ./apipie-bindings-0.2.0.tar.gz ...
/usr/lib/ruby/vendor_ruby/gem2deb/dh_make_ruby.rb:149:in `stat': No such
file or directory @ rb_file_s_stat -
/home/jenkins/.cache/gem2deb/gem_to_packages.yaml.new (Errno::ENOENT)
	from /usr/lib/ruby/vendor_ruby/gem2deb/dh_make_ruby.rb:149:in
`generate_or_update_gem_to_package_data'
	from /usr/lib/ruby/vendor_ruby/gem2deb/dh_make_ruby.rb:66:in `initialize'
	from ../../gem2deb:96:in `new'
	from ../../gem2deb:96:in `<main>'

It appears that both processes might be running the `apt-file` command,
redirecting into the same .new file and then only one succeeds in moving
the file, while the other fails to either stat or mv it.

Patch against version 0.33.1 attached, which uses a separate temporary
cache file per process, so it doesn't matter if another process is also
updating the same cache.

-- 
Dominic Cleal
dominic at cleal.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: concurrent_gem_to_packages_cache_update.patch
Type: text/x-patch
Size: 779 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-ruby-extras-maintainers/attachments/20170512/ca1705b1/attachment.bin>


More information about the Pkg-ruby-extras-maintainers mailing list