@Massimo- The initial issue was about reloading modules for development not 
production.

    from gluon.custom_import import track_changes; track_changes(True)

was not consistently reloading modules on each request while we were 
developing locally on the Rocket server, though I can't consistently 
reproduce this.

The second issue, which has me concerned about production, is that right 
now it's not clear to me what the boundaries are of modules and the 
execution environment in general. I had been under the assumption that, in 
wsgi applications, restarting the server would always clear out all modules 
and spawn a new execution environment. But we saw some behavior after 
Rocket restarts that looked like things were persisting across server 
restarts, though I can't say for certain.

Is it feasible that anything in the environment persist across wsgi server 
restarts? (If so then my understanding is all wrong). With Apache, does the 
configuration of mod_wsgi, and whether it's in embedded or daemon mode, 
have any bearing on this?







On Sunday, April 29, 2012 12:02:52 PM UTC-4, Massimo Di Pierro wrote:
>
> Let's clarify something....
>
> web2py always uses the most comment models/controllers/views.
> web2py (as Python does) loads modules onces and keeps them in memory, even 
> when modules are shipped with the app.
> The fact that 
>
>     from gluon.custom_import import track_changes; track_changes(True)
>
> overrides this behavior if a feature to be used in development, not in 
> production.
>
> Reloading modules is a bad idea. It has performance penalties and can 
> cause undesired effects because of global objects defined in the modules.
> A production application should not do this. 
>
>
>
> On Sunday, 29 April 2012 08:34:26 UTC-5, Yarin wrote:
>>
>> Got to say this is scary- we're about to go into production with our 
>> first web2py app, and having erratic module behavior persist across server 
>> restarts is not something we signed up for. Please let's address this.
>>
>> On Sunday, April 29, 2012 9:12:55 AM UTC-4, Yarin wrote:
>>>
>>> @Bruno- Thanks for confirming this issue
>>> @Anthony - Thoughts?
>>>
>>>
>>>>
On Sunday, April 29, 2012 12:02:52 PM UTC-4, Massimo Di Pierro wrote:
>
> Let's clarify something....
>
> web2py always uses the most comment models/controllers/views.
> web2py (as Python does) loads modules onces and keeps them in memory, even 
> when modules are shipped with the app.
> The fact that 
>
>     from gluon.custom_import import track_changes; track_changes(True)
>
> overrides this behavior if a feature to be used in development, not in 
> production.
>
> Reloading modules is a bad idea. It has performance penalties and can 
> cause undesired effects because of global objects defined in the modules.
> A production application should not do this. 
>
>
>
> On Sunday, 29 April 2012 08:34:26 UTC-5, Yarin wrote:
>>
>> Got to say this is scary- we're about to go into production with our 
>> first web2py app, and having erratic module behavior persist across server 
>> restarts is not something we signed up for. Please let's address this.
>>
>> On Sunday, April 29, 2012 9:12:55 AM UTC-4, Yarin wrote:
>>>
>>> @Bruno- Thanks for confirming this issue
>>> @Anthony - Thoughts?
>>>
>>>
>>>>

Reply via email to