Rails fails when db fails, still far behind Merb

2 views
Skip to first unread message
Message has been deleted

hipertracker

unread,
Jul 30, 2010, 6:17:18 PM7/30/10
to merb
I want to create fault-tolerant, self healing web application. It
means, situation when the application fails (with some weird errors on
the screen) should be *unacceptable*. Every exception should be
captured and handled by the application.

Everybody knows this is impossible in PHP (fatal errors cannot be
captured by any code). But not everybody aware that Rails is like PHP
here. If MySQL is down, Rails application raises exception which....
cannot be handled by any its controllers. This exception is not
propagated to them at all by the framework. I even created a ticket
http://bit.ly/cIQRTy thinking this was Rails 3.0RC only error. But
afterwards, I found Rails 2.3.8 "works" in the same way. It looks like
that error is in all Rails versions.

We have Rails 3.0 RC now and Rails 3.0 final is almost there. And I
hope Merb will still be continued and never disapear after Rails 3.0
final is relased...

--
JZ

Roy Wright

unread,
Jul 30, 2010, 9:35:08 PM7/30/10
to me...@googlegroups.com, merb
Maybe handle exception with rack?

Also maybe host on a high availability system (cluster) like pacemaker/corosync with hot (postgresql) database failover.


A free society is a single class society where everyone has the same rights.

On Jul 30, 2010, at 5:14 PM, hipertracker <hipert...@gmail.com> wrote:

> My want is to create fault-tolerant, self healing web application. It

> --
> You received this message because you are subscribed to the Google Groups "merb" group.
> To post to this group, send email to me...@googlegroups.com.
> To unsubscribe from this group, send email to merb+uns...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/merb?hl=en.
>

hipertracker

unread,
Jul 31, 2010, 5:40:41 PM7/31/10
to merb
Hi Roy,

I created small rack middleware but it could not be perfect solution.
I cannot redirect to any controller to handle the exception. All
controllers are infected. No matter what they do. Even if they do not
call database at all, they are broken if database is off.

All I can do is redirect to static page, or to different server, or
exchange database connection with another one, e.g. SQLite3.

On the other side, Merb can propagate such exception up to controllers
so it can be handled. But not Rails. No matter what version you use.
All are broken. This is lame.

On 31 Lip, 02:35, Roy Wright <r...@wright.org> wrote:

> Maybe handle exception with rack?
>
> Also maybe host on a high availability system (cluster) like pacemaker/corosync with hot (postgresql) database failover.
>
> A free society is a single class society where everyone has the same rights.
>
> On Jul 30, 2010, at 5:14 PM, hipertracker <hipertrac...@gmail.com> wrote:
>
> > My want is to create fault-tolerant, self healing web application. It
> > means, situation when the application fails (with some weird errors on
> > the screen) should be *unacceptable*. Every exception should be
> > captured and handled by the application.
>
> > Everybody knows this is impossible in PHP (fatal errors cannot be
> > captured by any code). But not everybody aware that Rails is like PHP
> > here. If MySQL is down, Rails application raises exception which....
> > cannot be handled by any its controllers. This exception is not
> > propagated to them at all by the framework. I even created a ticket
> >http://bit.ly/cIQRTythinking this was Rails 3.0RC only error. But

Jonathan Stott

unread,
Aug 10, 2010, 7:33:17 AM8/10/10
to me...@googlegroups.com
Controllers shouldn't be broken if the database is off, if they don't
use it. Could it be they're implicitly using the database, for
sessions or something of that nature? If that's the case, you might
be able to implement your own more robust session handler which deals
with absent DB errors. Or perhaps eschews the database all together,
and uses something like a high availability memcache or redis cluster.

Regards
Jon

Reply all
Reply to author
Forward
0 new messages