rss
twitter
    Find out what I'm doing, Follow Me :)

Infinite Redirection = less gooder

I am developing an application for a client using Fusebox 4.  Last night, I was implementing the exception handling plug-in available from the Fusebox 4 downloads page.  It seemed simple enough, and when I first tested it, it worked fine.  Whne I began to add redirections and e-mail capabilities, things started going wrong.



Everytime I would purposefully throw an error, my development server would hang...and then JRun would crash.  I watched the resources of my server get pegged at 100%.  After scaling back the code (there was not much there to begin with), I discovered the issue was with the <cflocation>.  The page that is being called is a simple page with a few lines of text and a link back to the main page.  It couldn't have been causing the server to lock up.

A little bit of advice.  If you ever use redircetion in any type of exception handing, make sure that the page you are redirecting to does not contain any errors!  After looking at the code on the redirection page for the 100th time, I discovered that I had accidentally pasted <cfset this = that> into the page.

Here is what would happen....I would go to a page that contained an error...the exception would be caught, an e-mail sent, and the user would be redirected to another page...which contained an error...that exception would be caught, and e-mail would be sent, and the user would be redirected  to the same page....which contained an error...you can see how this went.

Turns out,  the infintie redirection, and sending an e-mail during each iteration, took up quite a bit of resources...enough for JRun to say 'Enough already' before shutting down.

I am such an ass.

2 comments

(Comment Moderation is enabled. Your comment will not appear until approved.)
Doug Hughes said...
Circular references ROCK!
Scott Stroz said...
One good thing came of it though...I realized that the 'Mail Settings' in CFAdmin were not configured properly.

I would bet that getting several dozen, if not, several hundred, e-mails from my application would have clued me in to the cause of the crashes.