[mod_python] Bizarre error wiping globals() under mod_python ...

Monsyne Dragon mdragon at rackspace.com
Thu Jan 29 02:14:02 EST 2009


Graham Dumpleton wrote:
> 2009/1/29 Monsyne Dragon <mdragon at rackspace.com>:
>   
>> Ok, this is an odd one, any clues we can get would help.
>>
>> Environment mod_python 3.1.4 w/  python 2.4 on Ubuntu dapper
>>     
>
> Upgrade to mod_python 3.3.1. That version is old and buggy. See:
>
>   http://www.dscpl.com.au/wiki/ModPython/Articles/ModuleImportingIsBroken
>
> for one possible source of your problems.
>
>   
Ah.  Well, we'll check that out.  Would you happen to know of a 3.3.1 
backported package for Ubuntu Dapper (6.06) ?  It would be rather helpful.
If not we'll have to roll one ourselves.

(This is probably Yet Another reason we should be moving to Hardy (which 
has 3.3.1),  but this is a mission-critical app that basically runs a 
half-billion dollar a year company, and arranging  an OS upgrade on a 
system with two dozen servers between production, cert and dev 
environments in that kind of corporate environment is kindof like 
conducting a herd of wild African elephants in a tap-dance routine. It's 
pretty impressive when you pull it off, but there's alot of time and 
broken furniture involved in getting there. )

> Secondly, remember that Apache is a multi process web server. Don't
> expect globals you set in one process to be visible in another. See:
>
>   http://www.dscpl.com.au/wiki/ModPython/Articles/TheProcessInterpreterModel
>
>   
Yah, I'm aware of that.  This isn't doing anything funky with global 
variables, it's just doing an import at the top of a module and then 
trying to access the module it imported in a classes __init__  method a 
few lines down, and getting None instead of the module object (some of 
the time).

I'll see if upgrading mod_python helps here.
> Graham
>
>   
>> We have a web app running under mod_python (it uses an obscure templating
>> language/framework called PSE http://nick.borko.org/pse/)
>>
>> We are having an intermittent glitch which is truely bizarre.
>> Periodically, one module deep in this large webapp is losing it's global
>> namespace. On our production servers, this happens on random occasional
>> basis, but we have replicated it on another machine. On that machine it was
>> happening every other pagehit,
>> and is now happening every pagehit except the first one after restarting
>> apache (we don't know why this changed).
>> This manifests in mindbenders like: we will import a module, (like 'sys')
>> like so:
>>
>> import sys
>>
>> class SomeClass()
>>   def __init__(self, args, go, here):
>>         sys.stderr.write('Some message')
>>
>> This will run fine on the first hit, then subsequently will produce an
>> exception saying that "'NoneType' object has no attribute 'stderr'" !!
>> And it's not just 'sys' that that happens to. if we catch the exception and
>> print the contents of globals() at that point, ALL of the modules imported,
>> and any global variables  have their values  set to None!
>>
>> As far as we can tell, it is only happening to this one module in our
>> (large,  hundreds of modules) codebase.  The module itself  is actually
>> generated code, generated by the ZSI-2.0 SOAP library, and we've exercised
>> this code from the command line hundreds of times without fail, running it
>> in a loop.  It only fails like this in the mod_python environment, and then,
>> not every time.
>>
>> Does anyone have an idea of where to even begin to figure this out?
>>
>>
>>
>> --
>> --M. Dragon
>>
>>
>>
>> Confidentiality Notice: This e-mail message (including any attached or
>> embedded documents) is intended for the exclusive and confidential use of
>> the
>> individual or entity to which this message is addressed, and unless
>> otherwise
>> expressly indicated, is confidential and privileged information of
>> Rackspace.
>> Any dissemination, distribution or copying of the enclosed material is
>> prohibited.
>> If you receive this transmission in error, please notify us immediately by
>> e-mail
>> at abuse at rackspace.com, and delete the original message.
>> Your cooperation is appreciated.
>>
>> _______________________________________________
>> Mod_python mailing list
>> Mod_python at modpython.org
>> http://mailman.modpython.org/mailman/listinfo/mod_python
>>
>>     


-- 
--M. Dragon



Confidentiality Notice: This e-mail message (including any attached or
embedded documents) is intended for the exclusive and confidential use of the
individual or entity to which this message is addressed, and unless otherwise
expressly indicated, is confidential and privileged information of Rackspace.
Any dissemination, distribution or copying of the enclosed material is prohibited.
If you receive this transmission in error, please notify us immediately by e-mail
at abuse at rackspace.com, and delete the original message.
Your cooperation is appreciated.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20090129/27cc3a0f/attachment.html


More information about the Mod_python mailing list