[Mongrel] leaking weirdness
rogerpack2005 at gmail.com
Mon Apr 28 20:02:20 EDT 2008
On Mon, Apr 28, 2008 at 2:23 PM, Evan Weaver <evan at cloudbur.st> wrote:
> Maybe the upgrade installed fastthread?
Could have. Prolly wouldn't have done much since I'm running patch 111.
> Most likely though it's related to the Rails app itself, not Mongrel,
> and isn't immediately reproducible. Cache freshness could have a large
> effect on which codepaths get traversed.
It happened even with a 'blank, vanilla' rails app. All I had to do
was add an extra thread and run it in mongrel. rails 1.2.3
I believe the problem 'kicked off' no matter what page I
requested--meaning that basically rails had to load.
I wonder if the problem is that I started a thread BEFORE rails
loaded, and so some of that 'non thread safeness' of Ruby came back to
haunt me or something. It confused scopes or something. 
> What did you add that Thread loop for? I don't understand.
Originally it was a 'helper thread' that restarted my app if in
production and any files were changed. Then I saw that leaks were
happening, and replaced it with that one, to exaggerate the problem.
and was successful :)
I almost wish I could recreate it so I could kill these leaking bugs
once and for all. I was this close from diving into eval.c and
tearing into ruby's gc until I squashed it. So much for recreation I
As a side-note, from  we see that Ruby, at least the MRI of that
post, had some sockets that would be cross-threaded. I still can't
figure out why this doesn't occur with mongrel. Hmm.
More information about the Mongrel-users