I think I found the cause.

I was looking at using a uwsgi decorator @postfork to make it so that I 
could declare an import once and only once. In researching it, in the uwsgi 
docs I came across a section called "2.3.9 The fork() problem when you 
spawn multiple processes", which mentions that when a uwsgi server is 
started:

"By default uWSGI loads your application in the first spawned process and 
then fork() itself multiple times.

It means your app is loaded a single time and then copied.

While this approach speedups the start of the server, some application 
could have problems with this technique (especially those initializing db 
connections on startup, as the file descriptor of the connection will be 
inherited in the subprocesses). If you are unsure about the brutal 
preforking used by uWSGI, just disable it with the --lazy-apps option. It 
will force uWSGI to completely load your app one time per each worker."

I verified that my Cassandra session, connection, and query runs properly 
when enabling --lazy-apps. Using @postfork should be another solution.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to