title: Ruby process eat 100% cpu
body: <p>When im trying to logout from my app (using devise) rails application hangs and ruby eat 100% of CPU, after im restarting server it's stil frezeed(cant load page). It gone only when im drop and recreate my database. Im using PostgreSQL, trying to switch to MySQL, didnt help. Use mongrel(happens with webrick too). Ruby 1.9.2, rails 3.0.9</p>
  
  <p>strace</p>
  
  <pre><code>futex(0xe1be68, FUTEX_WAKE_PRIVATE, 1)  = 1
  futex(0xe1c3fc, FUTEX_WAIT_PRIVATE, 1, NULL) = ? ERESTARTSYS (To be restarted)
  --- SIGINT (Interrupt) @ 0 (0) ---
  rt_sigreturn(0x2)                       = -1 EINTR (Interrupted system call)
  futex(0xe1c3fc, FUTEX_WAIT_PRIVATE, 1, NULL) = 0
  futex(0xe1c458, FUTEX_WAKE_PRIVATE, 1)  = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  futex(0xe1be68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
  </code></pre>
  
  <p>console output:</p>
  
  <pre><code>Started GET "/signout" for 127.0.0.1 at 2011-11-09 10:11:13 +0200
    SQL (1.0ms)   SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
   FROM pg_attribute a LEFT JOIN pg_attrdef d
   ON a.attrelid = d.adrelid AND a.attnum = d.adnum
   WHERE a.attrelid = '"jokes"'::regclass
   AND a.attnum &gt; 0 AND NOT a.attisdropped
   ORDER BY a.attnum
    Processing by SessionsController#destroy as HTML
  Redirected to http://localhost:3000/
  Completed 302 Found in 1ms
  </code></pre>
  
  <p>Im not really sure what happens there?</p>
  
  <p>UPD* This is freeze happens not only on logout, it's happens randomly :( Also other developer on mac havent this problem, im running Ubuntu 11.10, tried on 10.04, still have it.</p>