We moved to edge rails last week, and have been seeing our Rails app crash with "Too many open files" after the app runs awhile in development mode. After some investigation, we found that the culprit is open filehandles pointing to our sqlite3 database (I'll attach a screenshot showing you what I mean). This only occurs in dev mode, and we essentially end up with an open filehandle per request.
So, we went looking at Dispatcher.reset_application! and discovered that commenting out ActiveRecord::Base.clear_reloadable_connections! made the problem go away. After looking further, we found that adding:
def disconnect!
@connection.close rescue nil
end
to sqlite_adapter.rb caused the driver to release the file handle and fixed the problem.
This is an easily reproducible problem, at least on OS X. I can provide a sample project if necessary.