Recursive partial wasted my 2 hours

Hi,

When I called a page, the server choked like frozen.
I checked it with ‘top’ command and HDD(wa) was 95%.
There’s no error or suspicious log.

After wasting 2 hours, I found that a partial called it self.
In _a.html.erb
<%= render :partial => “a” %>

Can rails detect such a mistake and stop proceeding and report it?

Thanks.

Sam

On Jun 11, 7:37 pm, Sam K. [email protected] wrote:

Can rails detect such a mistake and stop proceeding and report it?

In the absolute is this not the same as trying to solve the halting
problem ? (which has been proved to be unsolvable)

Fred

Every time I’ve done something like that, Rails has pulled me up short
with a “stack level too deep” error. That’s usually the only way you
can catch these things. Mistakes like this can’t be caught
automatically, since a partial calling itself can sometimes be valid
(when displaying a tree, for instance).

–Matt J.