Change config.environ() check_locale calls to async_check_locale
calls in the EbuildPhase/EbuildMetadataPhase _async_start method
in order to eliminate synchronous waiting for child processes in
the main event loop thread.

Note that this series of changes causes access to the portdbapi
doebuild_settings attribute to no longer be serialized via the
EbuildMetadataPhase _start_method. As a result, exclusive access
to config instances needs to be guaranteed in some other way to
avoid triggering problems (see bug 924319), such as by maintaining
a config pool or by serializing access via an asyncio.Lock instance.

This series can also be reviewed at https://github.com/gentoo/portage/pull/1267.

Bug: https://bugs.gentoo.org/923841
Bug: https://bugs.gentoo.org/924319
Signed-off-by: Zac Medico <zmed...@gentoo.org>

Zac Medico (9):
  anydbm: Pickle support for multiprocessing spawn
  EbuildMetadataPhase: Add deallocate_config future
  MetadataRegen: Use EbuildMetadataPhase deallocate_config
  ResolverPlayground: Use egencache to create manifests
  asyncio: Wrap asyncio.Lock for python 3.9 compat
  async_aux_get: Use EbuildMetadataPhase deallocate_config future
  actions: disable pytest-xdist for spawn start-method (workers crash)
  EbuildMetadataPhase: Migrate to _async_start
  EbuildPhase: async_check_locale

 .github/workflows/ci.yml                      |   5 +-
 lib/_emerge/EbuildMetadataPhase.py            |  37 ++++-
 lib/_emerge/EbuildPhase.py                    |  28 +++-
 lib/_emerge/MetadataRegen.py                  |  16 ++-
 lib/_emerge/SubProcess.py                     |   5 +-
 lib/_emerge/depgraph.py                       |  11 ++
 lib/portage/_emirrordist/FetchIterator.py     |  10 +-
 lib/portage/cache/anydbm.py                   |  17 ++-
 lib/portage/dbapi/porttree.py                 | 129 ++++++++++++------
 lib/portage/package/ebuild/config.py          |  26 ++--
 lib/portage/tests/dbapi/test_auxdb.py         |   4 +-
 lib/portage/tests/dbapi/test_portdb_cache.py  |   4 +-
 .../tests/resolver/ResolverPlayground.py      |  38 +++---
 lib/portage/tests/update/test_move_ent.py     |   3 +
 lib/portage/util/futures/_asyncio/__init__.py |  26 ++++
 lib/portage/util/locale.py                    |  28 ++--
 16 files changed, 289 insertions(+), 98 deletions(-)

-- 
2.41.0


Reply via email to