<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>has_many :thoughts: when timeouts aren't timeouts</title>
    <link>http://blog.kineticweb.com/articles/2009/02/09/when-timeouts-arent-timeouts</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Musings from a Ruby on Rails development team</description>
    <item>
      <title>when timeouts aren't timeouts</title>
      <description>&lt;p&gt;Last Friday, a good chunk of our team spent a while debugging a problem afflicting some sites on one of our shared hosting machines.&lt;/p&gt;


	&lt;p&gt;After a bunch of red herrings, some &lt;span class="caps"&gt;TCP&lt;/span&gt; dumps determined that the sites in question were all hung up on numerous &lt;span class="caps"&gt;DNS&lt;/span&gt; requests. That led us to the call to a web service we use on the sites in question. As it turns out, the IP geocode service being called, &lt;a href="http://www.hostip.info"&gt;HostIP.info&lt;/a&gt;, was completely down. (It&amp;#8217;s free; you get what you pay for.)&lt;/p&gt;


	&lt;p&gt;We assumed this couldn&amp;#8217;t be the case, since those calls are wrapped in a Ruby Timeout calls with a maximum of 2 seconds each (Timeout.timeout(2)). Well, apparently, Ruby Timeout &lt;a href="http://ph7spot.com/articles/system_timer"&gt;just doesn&amp;#8217;t work sometimes&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Big props to Andy for sleuthing that down. And bigger props to &lt;a href="http://ph7spot.com/"&gt;Philippe Hanrigou&lt;/a&gt; for writing that very detailed article where he says, specifically:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&amp;#8220;In particular, initiating network connections and/or a broken or slow &lt;span class="caps"&gt;DNS&lt;/span&gt; server will typically block the whole Ruby process while the call completes.&amp;#8221;&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;Bingo! We&amp;#8217;re going to try Philippe&amp;#8217;s library on these projects and others in the future when we need guaranteed timeouts.&lt;/p&gt;</description>
      <pubDate>Mon, 09 Feb 2009 19:11:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:81728fc6-1d26-4f79-afd6-12a29e0fcb48</guid>
      <author>Colin A. Bartlett</author>
      <link>http://blog.kineticweb.com/articles/2009/02/09/when-timeouts-arent-timeouts</link>
      <category>ruby</category>
      <category>timeout</category>
      <category>Rails</category>
    </item>
    <item>
      <title>"when timeouts aren't timeouts" by cheapRoc</title>
      <description>@Philippe, it would be great if the gem's RDoc or Yard would state that is has the same exception notices as Timeout. I was a bit confused right off the bat until I started using it and found that out.

Other than that the gem works excellent!</description>
      <pubDate>Thu, 26 Feb 2009 14:19:56 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:427d31eb-4834-43f4-ae49-d345b741cb97</guid>
      <link>http://blog.kineticweb.com/articles/2009/02/09/when-timeouts-arent-timeouts#comment-280</link>
    </item>
    <item>
      <title>"when timeouts aren't timeouts" by Philippe Hanrigou</title>
      <description>Hi Colin,


glad you found the article useful. This is exactly the kind of problem that got us started on SystemTimer ;-) Let me know about your experience with the gem...</description>
      <pubDate>Mon, 09 Feb 2009 23:29:54 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:2aa75b74-847b-437b-930d-0a0670964a12</guid>
      <link>http://blog.kineticweb.com/articles/2009/02/09/when-timeouts-arent-timeouts#comment-279</link>
    </item>
  </channel>
</rss>
