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

2013-08-18 Thread Arnaud Fontaine
Antoine Pitrou solip...@pitrou.net writes: Le Wed, 14 Aug 2013 14:17:59 +0900, Arnaud Fontaine arnaud.fonta...@nexedi.com a écrit : From my understanding of import.c source code, until something is added to sys.modules or the code loaded, there should be no side-effect to releasing the lock,

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

2013-08-14 Thread Arnaud Fontaine
Antoine Pitrou solip...@pitrou.net writes: Le Tue, 13 Aug 2013 17:28:42 +0900, Arnaud Fontaine arnaud.fonta...@nexedi.com a écrit : Yes. Actually, I was thinking about implementing something similar to what has been done in Python 3.3 but for Python 2.7 with a corser-grain lock. From my

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

2013-08-14 Thread Antoine Pitrou
Le Wed, 14 Aug 2013 14:17:59 +0900, Arnaud Fontaine arnaud.fonta...@nexedi.com a écrit : Antoine Pitrou solip...@pitrou.net writes: Le Tue, 13 Aug 2013 17:28:42 +0900, Arnaud Fontaine arnaud.fonta...@nexedi.com a écrit : Yes. Actually, I was thinking about implementing something similar

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

2013-08-13 Thread Antoine Pitrou
On Tue, 13 Aug 2013 11:06:51 +0900 Arnaud Fontaine arnaud.fonta...@nexedi.com wrote: Hi, Armin Rigo ar...@tunes.org writes: On Mon, Aug 12, 2013 at 9:39 AM, Arnaud Fontaine arnaud.fonta...@nexedi.com wrote: Thread 1 is trying to import a module 'foo.bar' (where 'foo' is a package

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

2013-08-13 Thread Brett Cannon
On Mon, Aug 12, 2013 at 10:10 PM, Arnaud Fontaine arnaud.fonta...@nexedi.com wrote: Brett Cannon br...@python.org writes: On Mon, Aug 12, 2013 at 5:12 AM, Arnaud Fontaine arnaud.fonta...@nexedi.com wrote: Yes, I saw the bug report and its patch implementing the import lock per module

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

2013-08-13 Thread Arnaud Fontaine
Antoine Pitrou solip...@pitrou.net writes: On Tue, 13 Aug 2013 11:06:51 +0900 Arnaud Fontaine arnaud.fonta...@nexedi.com wrote: I suggested the same in my initial email, but I was wondering if there could be any issue by releasing the lock in find_module()/load_module() until the module is

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

2013-08-13 Thread Antoine Pitrou
Le Tue, 13 Aug 2013 17:28:42 +0900, Arnaud Fontaine arnaud.fonta...@nexedi.com a écrit : Antoine Pitrou solip...@pitrou.net writes: On Tue, 13 Aug 2013 11:06:51 +0900 Arnaud Fontaine arnaud.fonta...@nexedi.com wrote: I suggested the same in my initial email, but I was wondering if there

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

2013-08-12 Thread Arnaud Fontaine
[I initially posted this email to python-list but didn't get any reply, probably because this is too related to python core, so I'm posting it again here, hope that's ok...] Hello, I'm currently working on implementing Import Hooks (PEP302) with Python 2.7 to be able to import modules whose code

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

2013-08-12 Thread Victor Stinner
I'm currently working on implementing Import Hooks (PEP302) with Python 2.7 to be able to import modules whose code is in ZODB. However, I have stumbled upon a widely known issue about import deadlock[0][1] (...) In Python 3.3, the import machinery has been rewritten (importlib is used by

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

2013-08-12 Thread Armin Rigo
Hi Arnaud, On Mon, Aug 12, 2013 at 9:39 AM, Arnaud Fontaine arnaud.fonta...@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

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

2013-08-12 Thread Arnaud Fontaine
Victor Stinner victor.stin...@gmail.com writes: I'm currently working on implementing Import Hooks (PEP302) with Python 2.7 to be able to import modules whose code is in ZODB. However, I have stumbled upon a widely known issue about import deadlock[0][1] (...) In Python 3.3, the import

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

2013-08-12 Thread Brett Cannon
On Mon, Aug 12, 2013 at 5:12 AM, Arnaud Fontaine arnaud.fonta...@nexedi.com wrote: Victor Stinner victor.stin...@gmail.com writes: I'm currently working on implementing Import Hooks (PEP302) with Python 2.7 to be able to import modules whose code is in ZODB. However, I have stumbled upon

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

2013-08-12 Thread Arnaud Fontaine
Hi, Armin Rigo ar...@tunes.org writes: On Mon, Aug 12, 2013 at 9:39 AM, Arnaud Fontaine arnaud.fonta...@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

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

2013-08-12 Thread Arnaud Fontaine
Brett Cannon br...@python.org writes: On Mon, Aug 12, 2013 at 5:12 AM, Arnaud Fontaine arnaud.fonta...@nexedi.com wrote: Yes, I saw the bug report and its patch implementing the import lock per module (mentioned in my initial email) and watched the presentation by Brett Cannon (BTW, I could