That's odd, I'm certainly not an expert so I think that these two suggestions are my only help unfortunately but I'm sure someone more knowledgable will chime in.
Again someone please correct me if I am wrong but I think that this error can occur when the connection is closed already before rails attempts to perform its action. Therefore, firstly are you forking using multiple threads or doing anything that might cause the connection to be lost at the socket level? Secondly as a bodge, what about attempting to make sure the connection exists before running the command and if not reconnecting? (ActiveRecord::Base.establish_connection). Finally I'm sure you have already tried this so it's not really a solution but do you have the latest version of the PG gem just in case it's something in there? I can imagine how frustrating this can be as these things are hard to replicate so sorry I can't help any more but hopefully someone will be able to. Steve On 9 Aug 2010, at 15:27, Eric Anderson wrote: > On Aug 9, 10:05 am, Steve Smith <[email protected]> wrote: >> Hey, I haven't seen the errors personally and have quite a few apps running >> on Heroku. I have been really happy with the service. >> >> However, does the failure actually stop the rendering of your page and raise >> an error? I think what heroku are suggesting is that when the connection is >> lost the client library should reconnect and try again without raising an >> error, I take it this is not the case? > > Yes, it stops rendering the page since the Exception is not caught by > anything. My problem with their response (and what I asked them with > no response back) is: > > 1. Where do I do this re-connection. Shoud I surround each DB query > with a rescue block? Seems cumbersome. Or do I monkey-patch it deep in > the Rails framework where the requests are being submitted. > 2. For a SELECT I could just re-submit but what about an INSERT or > UPDATE? Did the previous one go through? Should I resubmit those? > > To these questions I got NO response from Heroku. > > -- > You received this message because you are subscribed to the Google Groups > "Heroku" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/heroku?hl=en. > -- You received this message because you are subscribed to the Google Groups "Heroku" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/heroku?hl=en.
