A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-August/127903.html below:

[Python-Dev] Dealing with import lock deadlock in Import Hooks

[Python-Dev] Dealing with import lock deadlock in Import Hooks [Python-Dev] Dealing with import lock deadlock in Import HooksArmin Rigo arigo at tunes.org
Mon Aug 12 11:09:45 CEST 2013
Hi Arnaud,

On Mon, Aug 12, 2013 at 9:39 AM, Arnaud Fontaine
<arnaud.fontaine at nexedi.com> wrote:
>   Thread 1 is trying to import a module 'foo.bar' (where 'foo' is a
>   package containing dynamic modules) handled by Import Hooks I
>   implemented, so import lock is acquired before even running the hooks
>   (Python/import.c:PyImport_ImportModuleLevel()). Then, these import
>   hooks try to load objects from ZODB and a request is sent and handled
>   by another thread (Thread 2) which itself tries to import another
>   module.

A quick hack might be to call imp.release_lock() and
imp.acquire_lock() explicitly, from your import hook code, around
calls to ZODB.


A bientôt,

Armin.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4