Re: plpython intermittent ImportErrors

From: Brian Sutherland <brian(at)vanguardistas(dot)net>
To: Chris Angelico <rosuav(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: plpython intermittent ImportErrors
Date: 2013-01-16 12:03:27
Message-ID: 20130116120327.GD12740@Brians-MacBook-Air.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)vanguardistas(dot)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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

--
Brian Sutherland

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2013-01-16 14:21:35 Re: Independent backups of subdatabases
Previous Message Stuart Bishop 2013-01-16 12:00:56 Re: Linux Distribution Preferences?