title: What happens serverside when the originator of a request closes the TCP/IP?
body: <p>Let's say my controller action is taking a long time to process the request, without streaming anything back to the browser, and the browser decides to time out and close the TCP/IP connection.</p>
  
  <p>Like this beautiful code:</p>
  
  <pre><code>class MyController
    def index
      sleep 10000
    end
  end
  </code></pre>
  
  <p>In theory (technically), the server <em>could</em> detect the TCP/IP channel going down and immediately raise some kind of exception in the controller.</p>
  
  <p>The question is: does Rails (or, rather, Rack) support anything like this? Does it actually happen? Is the behaviour around this issue specified, or is it up to one of the components (say, the actual server like <code>thin</code>, the <code>rack</code> middleware or anything else? Or does the server just run blithely until it finally comes to its natural end, at which point it will probably hit a "EOS" exception when trying to write to the now defunct TCP/IP socket?</p>
  
  <p>EDIT: Oh, and since this is probably also very dependant on the Ruby implementation, I am talking about a moderately current stock Ruby on a Linux machine (not JRuby or one of the more "special" ones).</p>