[Nitro] FastCGI is broken because of Og.thread_safe not having an Og.manager.store

Rob Pitt rob at motionpath.com
Fri Jan 27 04:28:10 EST 2006


There was no error connecting to the database (I used set_trace_proc to
log exceptions while starting it up a couple of days ago). There were no
files being reloaded. I see what you mean about popping from the array,
I imagine it must be that for some reason other than their being a
connection error none of the connections are ever opened. I will
investigate this later... thanks.


On Thu, 2006-01-26 at 17:38 -0800, Bryan Soto wrote:
> On 1/26/06, Rob Pitt <rob at motionpath.com> wrote:
>         Og.manager.store returned nil causing lots of Og functions to
>         stop
>         working. Using irb from a separate thread in the same process
>         revealed
>         @store_class and @options were setup OK (and store really was
>         nil).
>         
>         I could get a backtrace later, where do you want a backtrace
>         from, from 
>         the part of the code that generates the connection pool?
>         
> 
> I was just trying to understand what the problem was. I guess a
> backtrace wouldn't be useful if it's just no method errors.
> 
> It looks like you could be getting nil as store if you're running a
> multi-threaded app running more than five threads. Specifically, the
> line in og/lib/manager.rb:83
> 
> st = @pool.pop()
> 
> Array#pop, which Pool subclasses, returns nil from an empty array.
> 
> If that's the case, it looks like you should set :connection_count
> (og/lib/og/manager.rb:66) in the Og.setup hash to something higher
> than 5 or add calls to Og::Manager#put_store from the thread when
> you're done with it.
> 
> If that's not the case, then maybe you're running into errors
> connecting to your database? If you're not running a multi-threaded
> app, could you try disabling the auto-reload of files? That runs in a
> separate thread, and if you're reloading the file containing Og#setup,
> that might be what's taking all your pooled connections.
> 
> George, should Og.thread_safe really default to true? Please note that
> in Manager#get_store, Thread.current is retrieved and a thread local
> variable, og_store, is set. In a single-threaded app, this would have
> the affect of only allowing a single connection for the entire app
> which is the problem Lars was running into in
> 
> http://rubyforge.org/pipermail/nitro-general/2006-January/002568.html
> 
> bryan
> 
> 
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general




More information about the Nitro-general mailing list