Forum: Ruby on Rails Interrupted query causes "Rails application failed to start

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Richard Williams (Guest)
on 2006-02-20 21:35
(Received via mailing list)
Given a "find" screen that hooks to controller that does an sql find.
(this is a mysql db).   Lets say you have a table with several thousand
rows and the find that you do will return a result containing every row
in the db.  I.e. it takes 15 seconds or longer.

When I do this find and then click the "stop" button in my browser to
interrupt the query, then soon after try any other page of the app I get
the "Rails application failed to start properly" error after what seems
like enough time for the prior find to finally complete.

I think what I'm seeing is that if you "stop" the browser, the stop is
not conveyed into the application and is not stopping the database query
that was launched causing the app to wait on the completion of the
query.

Is this possible?  Known problem?

How do you prevent this behavior?
97e3d8ba68b082414cc3438d15c9d6e2?d=identicon&s=25 Robert Evans (Guest)
on 2006-02-20 22:46
(Received via mailing list)
Not sure if it is related, but I was getting that same exact message
but because I was running under FastCGI and I had puts statments that
were getting evaluated. FastCGI receives the puts as the output
stream to be rendered to the browser, it doesn't match what it
expects so it reports that Rails died. Perhaps your stop causes an
error message to print that makes FastCGi confused?

Bob Evans
4005a47a8f2ceee49670b920593c1d52?d=identicon&s=25 Ben Munat (Guest)
on 2006-02-21 05:19
(Received via mailing list)
I don't know what's going on with the rails error, but your brower stop
button doesn't
send anything to the app... it just stops the browser from waiting for
the response.

Welcome to the wonderful of web programming!

b

PS: Whe you have a long query like that you could return a "processing
your request"
progess page that has a refresh header to have it poll the server every
few seconds. You
could then put a "cancel query" link on there, that tells rails to canel
the query. Of
course, you'd still need to figure out how to tell the db to cancel the
query....
This topic is locked and can not be replied to.