Summary: | sys-apps/portage: sync failure after sync-rcu-store-dir is removed | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Zac Medico <zmedico> |
Component: | Core | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | InVCS |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 733180 |
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=b0c535b7310e7724d8feb0570b827d38c5d17fc3 commit b0c535b7310e7724d8feb0570b827d38c5d17fc3 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2020-07-31 21:40:53 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2020-07-31 22:00:21 +0000 HardlinkRcuRepoStorage: handle removed sync-rcu-store-dir (bug 734990) If SyncManager.pre_sync creates an empty directory where self._latest_symlink is suppose to be (which is normal if sync-rcu-store-dir has been removed), then we need to remove the directory or else rename will raise IsADirectoryError when we try to replace the directory with a symlink. Bug: https://bugs.gentoo.org/734990 Signed-off-by: Zac Medico <zmedico@gentoo.org> lib/portage/repository/storage/hardlink_rcu.py | 13 ++++++++++++- lib/portage/tests/sync/test_sync_local.py | 10 ++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c2610ab321d23a1f1d70cc7a550225c1213dbfa commit 5c2610ab321d23a1f1d70cc7a550225c1213dbfa Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2020-08-09 06:21:51 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2020-08-09 06:24:00 +0000 sys-apps/portage: Bump to version 3.0.2 #711174 Identified and fixed some FEATURES=compress-build-logs corruption issues #734990 Fix sync-rcu to recover from removed sync-rcu-store-dir #735626 Add example postsync hook to call egencache --update-pkg-desc-index #736334 Add fork safety to sqlite cache module Bug: https://bugs.gentoo.org/733180 Bug: https://bugs.gentoo.org/711174 Bug: https://bugs.gentoo.org/734990 Bug: https://bugs.gentoo.org/735626 Bug: https://bugs.gentoo.org/736334 Package-Manager: Portage-3.0.2, Repoman-2.3.23 Signed-off-by: Zac Medico <zmedico@gentoo.org> sys-apps/portage/Manifest | 1 + sys-apps/portage/portage-3.0.2.ebuild | 263 ++++++++++++++++++++++++++++++++++ 2 files changed, 264 insertions(+) |
If sync-rcu-store-dir is removed, then SyncLocalTestCase fails like this when trying to update the latest symlink, since SyncManager.pre_sync creates an empty directory where the latest symlink is supposed to be: > Traceback (most recent call last): > File "portage/util/_async/AsyncFunction.py", line 39, in _run > result = self.target(*(self.args or []), **(self.kwargs or {})) > File "portage/sync/controller.py", line 168, in sync > taskmaster.run_tasks(tasks, func, status, options=task_opts) > File "portage/sync/controller.py", line 68, in run_tasks > result = getattr(inst, func)(**kwargs) > File "portage/sync/syncbase.py", line 317, in sync > return self.update() > File "portage/sync/modules/rsync/rsync.py", line 194, in update > self.repo_storage.commit_update() > File "portage/util/futures/_sync_decorator.py", line 21, in wrapper > return loop.run_until_complete(func(*args, **kwargs)) > File "portage/util/_eventloop/EventLoop.py", line 806, in run_until_complete > return future.result() > File "portage/util/futures/compat_coroutine.py", line 115, in _next > future = next(self._generator) > File "portage/repository/storage/hardlink_rcu.py", line 207, in commit_update > os.rename(new_symlink, self._latest_symlink) > File "portage/__init__.py", line 227, in __call__ > rval = self._func(*wrapped_args, **wrapped_kwargs) > IsADirectoryError: [Errno 21] Is a directory: b'/tmp/tmploorh7c6/var/repositories/test_repo_rcu_storedir/latest.new' -> b'/tmp/tmploorh7c6/var/repositories/test_repo_rcu_storedir/latest'