Created attachment 386760 [details, diff] retry os calls upon EINTR This backtrace in a Prefix buildbot slave on some sparc-solaris2.10 machine leads me to attached patch: File "/.../lib/portage/pym/portage/util/_async/ForkProcess.py", line 45, in _spawn rval = self._run() File "/.../lib/portage/pym/_emerge/EbuildFetcher.py", line 172, in _run allow_missing_digests=allow_missing): File "/.../lib/portage/pym/portage/package/ebuild/fetch.py", line 515, in fetch if _userpriv_test_write_file(mysettings, write_test_file): File "/.../lib/portage/pym/portage/package/ebuild/fetch.py", line 130, in _userpriv_test_write_file returncode = _spawn_fetch(settings, args) File "/.../lib/portage/pym/portage/package/ebuild/fetch.py", line 98, in _spawn_fetch rval = spawn_func(args, env=settings.environ(), **kwargs) File "/.../lib/portage/pym/portage/process.py", line 378, in spawn retval = os.waitpid(pid, 0)[1] File "/.../lib/portage/pym/portage/__init__.py", line 260, in __call__ rval = self._func(*wrapped_args, **wrapped_kwargs) OSError: [Errno 4] Interrupted system call What do you think?
Note that modules wrapped by _unicode_module_wrapper include os, shutil, and selinux. It doesn't necessarily make sense to loop (as your patch does) for all of the functions in all of those modules. I'm not sure whether or not that loop will have any negative consequences for some of the wrapped functions. You might consider limiting this behavior to specific modules, or to specific functions in those modules.
(In reply to Zac Medico from comment #1) > You might consider limiting this behavior to specific modules, or > to specific functions in those modules. For example, see the _os_overrides variable, which is used to specify which os functions should not be wrapped by _unicode_func_wrapper. You could put your EINTR/loop behavior in a separate wrapper class, and use that wrapper to wrap the specific functions that would benefit from it (such as os.waitpid).
(In reply to Zac Medico from comment #2) > For example, see the _os_overrides variable, which is used to specify which > os functions should not be wrapped by _unicode_func_wrapper. You could put > your EINTR/loop behavior in a separate wrapper class, and use that wrapper > to wrap the specific functions that would benefit from it (such as > os.waitpid). I have a patch in this branch: https://github.com/zmedico/portage/tree/bug_525552 I've posted it for review here: http://thread.gmane.org/gmane.linux.gentoo.portage.devel/4896
LGTM, thanks!
This is in the master branch now: https://github.com/gentoo/portage/commit/7c70eea2f607baffcbb9d465c03578d69b09decf( In reply to Michael Haubenwallner from comment #4) > LGTM, thanks! You're welcome!
*** Bug 500436 has been marked as a duplicate of this bug. ***
*** Bug 504568 has been marked as a duplicate of this bug. ***
This is fixed in since 2.2.15.