title: What happen to existing server queries when pushing new Rails code to Heroku or putting it in maintenance mode?
body: <p>This page <a href="http://devcenter.heroku.com/articles/maintenance-mode" rel="nofollow">http://devcenter.heroku.com/articles/maintenance-mode</a> doesn't give any indication.
  Server queries to Heroku could run up to 30 seconds before they got terminated forcefully. So I am wondering what would happen if I push new code to the busy server, or set it to be in Maintenance mode?  Would the existing queries just stopped?  What if it is writing to a database, etc?  Would it leave my data in a corrupted state?</p>
  
  <p>Is there a correct way to let Rails app  to shut down gracefully (finishing existing queries but not accepting any new one), so that I can upgrade the server code?</p>
  
  <p>Thanks.</p>