What state were the sockets being left in? TIME_WAIT?
I tried to replicate the error, and I noticed via netstat that a lot
of sockets were open and set to TIME_WAIT. This appears to be a
problem with Java NIO and the settings of the operating system:
Is that the problem you were seeing?
- James
Version 0.2.5 used an earlier version of Jetty (6.1.14, rather than
6.1.26). Other than that, there haven't been many significant changes,
although it's possible that a small bug fix produced this behaviour.
When you downgraded to 0.2.5, did you just replace the
ring-jetty-adapter jar, or did you change the version in your
project.clj file (and therefore, downgrade the Jetty version and
ring-servlet version at the same time)?
- James
I'll resurrect an old thread, since the issue still exists. I recently found some time to track this down. To recap the story so far: my ring application started to predictably crash under load with "Too many open files" after several hours when I switched from Ring 0.2.5 to 0.3.7.I upgraded ring to 0.3.11 and confirmed the problem is there.
:dependencies [[org.mortbay.jetty/jetty "6.1.25"]
[ring/ring-jetty-adapter "0.3.11" :exclusions [org.mortbay.jetty/jetty]]]
Something similar should be possible with Maven also.
Have you considered using the latest Ring, excluding its Jetty
dependency, and adding your own? Leiningen supports this, e.g.::dependencies [[org.mortbay.jetty/jetty "6.1.25"]
[ring/ring-jetty-adapter "0.3.11" :exclusions [org.mortbay.jetty/jetty]]]
I think I probably will, but in the meantime you can use Constantine's
solution. I believe that the dependencies specified in your
project.clj will always override Ring's own dependencies, so you're
not forced to use specific versions if they don't work for you.
- James