Reloading Rails Dynamically
-
macournoyer
- Milestone set to Future
- State changed from new to hold
Mongrel does it w/ the HUP signal but it's not working very well.
As it's written when Mongrel boots:
Rails signals registered. HUP => reload (without restart). It might not work well.I don't think anybody is using this.
But if you got a stable way to reload a Rails app, I'd be glad to include it.
-
Alex MacCaw
Well, here's the patch. I've also added reload support to the runner, so you can do:
thin reload --servers 3 -e production
and it'll go through all of them giving them the HUP signal.
I'll do a bit more testing to see how stable it is (it's working fine at the moment though). Basically I'm doing exactly what the console's reload! method does, but with a few added extras that ensure controllers (and hopefully plugins) get reloaded too. Maybe it would be a good idea to catch a reload exception (if any) and restart instead?
-
macournoyer
- State changed from hold to open
That definitely require some testing before including. But it looks very interesting.
thx for the patch Alex
-
Alex MacCaw
Unfortunately, a colleague from work tells me that it's likely to suffer from memory leaks, even if you kick of the garbage collector manually. So restarting is the only sure way of cleaning up. I suppose the other option would be a rolling restart, perhaps that could be added to thin's cluster support?
-
macournoyer
You mean something like this http://blog.carlmercier.com/2007... ?
-
Alex MacCaw
Yes, we could have an options to do a simple rolling restart, i.e. making sure only one thin server is down at any time. Would you like a patch for that?
-
macournoyer
- Tag set to rails
- State changed from open to invalid
create another ticket w/ patch for rolling restart as an option
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
