Hi,

I am working with Restlet 2.1.2, using both client and server
code as parts of a larger applications.

After working correctly for some time (maybe days),
a GET request causes an endless succession of
"Too many open files" exceptions. As it happens,
those are being written into a log file (by nohup) and
eventually exhaust all available disk space -- it appears
the exceptions just keep pouring out, one after another.
Maybe the failed connection is retried immediately, so that
fails again with the same error? Just guessing. I looked at
the source code but I can't tell what's going on.

Here is one such exception. The message is printed by
ServerConnectionController.onSelected.

  Unexpected error while accepting new connection

  java.io.IOException: Too many open files
        at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
        at 
sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:163)
        at 
org.restlet.engine.connector.ServerConnectionController.onSelected(ServerConnectionController.java:103)
        at 
org.restlet.engine.connector.ConnectionController.selectKeys(ConnectionController.java:308)
        at 
org.restlet.engine.connector.ConnectionController.doRun(ConnectionController.java:171)
        at org.restlet.engine.connector.Controller.run(Controller.java:159)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:679)

(Yes, maybe I could rework the logging configuration so
that it would only fill up a certain amount and then rotate
the log file. That doesn't address the underlying problem.)

It might (or might not) be the case that the error occurs
after a long time in which there are no requests -- i.e.
that it happens on the first request after a long pause.
Not sure about that.

Has anyone seen such a problem? Yes, it would really
help if I could narrow down the problem in time & space.
Yes, I certainly want to do that, and I have not yet
succeeded at it.

Host OS is RedHat Enterprise Linux 6.
java -version says:

  java version "1.6.0_24"
  OpenJDK Runtime Environment (IcedTea6 1.11.3) (rhel-1.48.1.11.3.el6_2-x86_64)
  OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

Thanks for any light you can shed on this problem.

Robert Dodier

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3055447

Reply via email to