Re: plpython intermittent ImportErrors - Mailing list pgsql-general

From Brian Sutherland
Subject Re: plpython intermittent ImportErrors
Date
Msg-id 20130116120327.GD12740@Brians-MacBook-Air.local
Whole thread Raw
In response to Re: plpython intermittent ImportErrors  (Chris Angelico <rosuav@gmail.com>)
List pgsql-general
On Wed, Jan 16, 2013 at 08:10:26AM +1100, Chris Angelico wrote:
> On Tue, Jan 15, 2013 at 4:55 AM, Brian Sutherland
> <brian@vanguardistas.net> wrote:
> > I'm guessing that it's some kind of race condition, but I wouldn't know
> > where to start looking.
>
> Look for a recursive import (A imports B, B imports A)

I've always seen circular imports as deterministic.

But I don't think it's this, because at least some of the tracebacks
occur when importing standard library code during "import site" at
interpreter startup. It's very unlikely there's a circular import there.

> or multiple
> threads trying to import simultaneously - Python sometimes has issues
> with that. Quite a few of those issues were sorted out in recent 3.x
> versions, but you're using 2.7.

I thought Python, even in 2.7, had an import lock to prevent multiple
threads importing simultaneously:

    http://docs.python.org/2/library/imp.html#imp.lock_held

But yes, that could be a lead onto the issue, if the import lock were
broken that could result in the behaviour I see.

Hmm, but checking in the various modules shows that the import lock is
being correctly acquired.

>
> ChrisA
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

--
Brian Sutherland


pgsql-general by date:

Previous
From: Stuart Bishop
Date:
Subject: Re: Linux Distribution Preferences?
Next
From: "SUNDAY A. OLUTAYO"
Date:
Subject: Re: Linux Distribution Preferences?