Hi. I''m using backgroundrb to, in part, wrap smtp transactions made through actionmailer. The problem is that when smtp fails with a timeout error, the worker simply stops at that point. No exception is returned. I''ve tried wrapping this call in a begin...rescue block but no exception seems to be making it back to the worker (other methods are correctly passing exceptions to the worker). I''ve tested to see if this is an issue of the delay prior to the exception being thrown by creating a method that sleeps prior to throwing an exception but this is passed through and caught without issue. When I generate smtp timeout errors in console, I receive the exception normally. I''m trying to figure out what could be different about the combination of backgroundrb and actionmailer. If anyone has suggestions for what else I can try in testing this or has experience with this, I''d very much appreciate the help. Thanks in advance! -Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20070611/a10f04ef/attachment.html
Hi Justin, I am experiencing a similar problem. I am performing some screen scraping, and then sending out emails. My worker basically starts once, has a sleep call, to ensure it runs every hour...but eventually, after a while it just stops running. I believe this problem is related to the mailer (sendmail) in my case, but i cant seem to track it down, and no exception is thrown. On 6/11/07, Justin Garten <jgarten at postful-inc.com> wrote:> > Hi. > > I''m using backgroundrb to, in part, wrap smtp transactions made through > actionmailer. The problem is that when smtp fails with a timeout error, the > worker simply stops at that point. > > No exception is returned. I''ve tried wrapping this call in a > begin...rescue block but no exception seems to be making it back to the > worker (other methods are correctly passing exceptions to the worker). > > I''ve tested to see if this is an issue of the delay prior to the exception > being thrown by creating a method that sleeps prior to throwing an exception > but this is passed through and caught without issue. > > When I generate smtp timeout errors in console, I receive the exception > normally. I''m trying to figure out what could be different about the > combination of backgroundrb and actionmailer. > > If anyone has suggestions for what else I can try in testing this or has > experience with this, I''d very much appreciate the help. > > Thanks in advance! > > -Justin > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20070612/117cc944/attachment.html
Have you tried wrapping the delivery in a Timeout block? Something along the lines of begin Timeout::timeout(15) do ActionMailer.stuff(weeeee) end rescue Timeout::Error # ActionMailer took too long end It might work, but I have admittely not tested this in the least. Geoff On 11 Jun 2007, at 22:55, Justin Garten wrote:> Hi. > > I''m using backgroundrb to, in part, wrap smtp transactions made > through actionmailer. The problem is that when smtp fails with a > timeout error, the worker simply stops at that point. > > No exception is returned. I''ve tried wrapping this call in a > begin...rescue block but no exception seems to be making it back to > the worker (other methods are correctly passing exceptions to the > worker). > > I''ve tested to see if this is an issue of the delay prior to the > exception being thrown by creating a method that sleeps prior to > throwing an exception but this is passed through and caught without > issue. > > When I generate smtp timeout errors in console, I receive the > exception normally. I''m trying to figure out what could be > different about the combination of backgroundrb and actionmailer. > > If anyone has suggestions for what else I can try in testing this > or has experience with this, I''d very much appreciate the help. > > Thanks in advance! > > -Justin-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20070612/0a287c93/attachment.html
Wil, Thank you for the pointer. I changed the line, but unfortunately that doesn''t seem to be the problem. I added some statements around it just to make sure, but that doesn''t seem to be where things are catching in this case (although it''s great to have one bug out of the way _before_ I hit it). -Justin On 6/11/07, Wil Chung <iamwil at gmail.com> wrote:> > I''ve had similar problems too, but Mathias Meyer pointed out that the > problem is probably > > line 48 of server/lib/backgroundrb/scheduler.rb. > > http://rubyforge.org/pipermail/backgroundrb-devel/2007-April/<http://rubyforge.org/pipermail/backgroundrb-devel/2007-April/000875.html> > 000875.html<http://rubyforge.org/pipermail/backgroundrb-devel/2007-April/000875.html> > > I tried it and it seems to spit back exceptions now, in the > background_server.log. > > It was suggested about a month or two ago, but it hasn''t made it into a > new release. So you can try monkey patching it yourself, or try to find a > way to submit a patch. > > Wil > > On 6/11/07, Justin Garten <jgarten at postful-inc.com> wrote: > > > Hi. > > > > I''m using backgroundrb to, in part, wrap smtp transactions made through > > actionmailer. The problem is that when smtp fails with a timeout error, the > > worker simply stops at that point. > > > > No exception is returned. I''ve tried wrapping this call in a > > begin...rescue block but no exception seems to be making it back to the > > worker (other methods are correctly passing exceptions to the worker). > > > > I''ve tested to see if this is an issue of the delay prior to the > > exception being thrown by creating a method that sleeps prior to throwing an > > exception but this is passed through and caught without issue. > > > > When I generate smtp timeout errors in console, I receive the exception > > normally. I''m trying to figure out what could be different about the > > combination of backgroundrb and actionmailer. > > > > If anyone has suggestions for what else I can try in testing this or has > > experience with this, I''d very much appreciate the help. > > > > Thanks in advance! > > > > -Justin > > > > _______________________________________________ > > Backgroundrb-devel mailing list > > Backgroundrb-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > > > > > -- > http://www.3cglabs.com > http://thoughtl.us-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20070612/2605d060/attachment.html
Geoff, I tried this previously, thinking that it would at least catch and repackage the exception in a way that might make it through to backgroundrb, but it didn''t help. Since I have no problem with other exceptions being passed through, I was surprised that this didn''t work. I must admit, I''m quite stumped at this point. -Justin On 6/12/07, Geoff Garside <ruby at geoffgarside.co.uk> wrote:> > Have you tried wrapping the delivery in a Timeout block? Something along > the lines of > begin > Timeout::timeout(15) do > ActionMailer.stuff(weeeee) > end > rescue Timeout::Error > # ActionMailer took too long > end > > It might work, but I have admittely not tested this in the least. > > Geoff > > > On 11 Jun 2007, at 22:55, Justin Garten wrote: > > Hi. > > I''m using backgroundrb to, in part, wrap smtp transactions made through > actionmailer. The problem is that when smtp fails with a timeout error, the > worker simply stops at that point. > > No exception is returned. I''ve tried wrapping this call in a > begin...rescue block but no exception seems to be making it back to the > worker (other methods are correctly passing exceptions to the worker). > > I''ve tested to see if this is an issue of the delay prior to the exception > being thrown by creating a method that sleeps prior to throwing an exception > but this is passed through and caught without issue. > > When I generate smtp timeout errors in console, I receive the exception > normally. I''m trying to figure out what could be different about the > combination of backgroundrb and actionmailer. > > If anyone has suggestions for what else I can try in testing this or has > experience with this, I''d very much appreciate the help. > > Thanks in advance! > > -Justin > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20070612/6aa0e6e3/attachment-0001.html