Summary: |
portage.cache.fs_template._ensure_dirs is not parallel safe, os.mkdir may throw EEXIST |
Product: |
Portage Development
|
Reporter: |
Michael Haubenwallner (RETIRED) <haubi> |
Component: |
Core | Assignee: |
Portage team <dev-portage> |
Status: |
RESOLVED
FIXED
|
|
|
Severity: |
normal
|
CC: |
prefix
|
Priority: |
Normal
|
Keywords: |
InVCS, PATCH |
Version: |
unspecified | |
|
Hardware: |
All | |
|
OS: |
Linux | |
|
Whiteboard: |
|
Package list:
|
|
Runtime testing required:
|
---
|
Bug Depends on: |
|
|
|
Bug Blocks: |
484436
|
|
|
Attachments: |
_ensure_dirs: ignore EEXIST from mkdir
|
Created attachment 389218 [details, diff] _ensure_dirs: ignore EEXIST from mkdir Creating a distfiles tarball snapshot (containing distfiles for all ebuilds with stable keywords in my Prefix-based distro, for offline install) using the command 'ebuild path-to/stable/stable-PVR.ebuild fetch' in parallel may fail with this backtrace with prefix-portage-2.2.10.1, leading me to attached patch: Thanks! Traceback (most recent call last): File "/opt/toolsbox/toolsbase-2015/usr/bin/ebuild", line 147, in <module> ebuild_portdir not in portage.portdb.porttrees: File "/opt/toolsbox/toolsbase-2015/usr/lib/portage/pym/portage/proxy/objectproxy.py", line 22, in __getattribute__ result = object.__getattribute__(self, '_get_target')() File "/opt/toolsbox/toolsbase-2015/usr/lib/portage/pym/portage/__init__.py", line 689, in _get_target return _get_legacy_global(name) File "/opt/toolsbox/toolsbase-2015/usr/lib/portage/pym/portage/_legacy_globals.py", line 14, in _get_legacy_global portage.portdb = portage.db[portage.root]["porttree"].dbapi File "/opt/toolsbox/toolsbase-2015/usr/lib/portage/pym/portage/util/__init__.py", line 1472, in __getitem__ result = lazy_item.func(*pargs, **kwargs) File "/opt/toolsbox/toolsbase-2015/usr/lib/portage/pym/portage/dbapi/porttree.py", line 1089, in __init__ self.dbapi = portdbapi(mysettings=settings) File "/opt/toolsbox/toolsbase-2015/usr/lib/portage/pym/portage/dbapi/porttree.py", line 240, in __init__ self.depcachedir, x, self._known_keys, **cache_kwargs) File "/opt/toolsbox/toolsbase-2015/usr/lib/portage/pym/portage/cache/flat_hash.py", line 37, in __init__ self._ensure_dirs() File "/opt/toolsbox/toolsbase-2015/usr/lib/portage/pym/portage/cache/fs_template.py", line 72, in _ensure_dirs os.mkdir(base, perms) File "/opt/toolsbox/toolsbase-2015/usr/lib/portage/pym/portage/__init__.py", line 260, in __call__ rval = self._func(*wrapped_args, **wrapped_kwargs) OSError: [Errno 17] File exists: '/opt/toolsbox/toolsbase-2015/var/cache/edb/dep/ftp/pub/portage/toolsbox-tree-20141112'