2 Replies Latest reply on Dec 15, 2011 6:27 AM by Aleš Bregar

    Jbossweb throws ArrayIndexOutOfBoundsException on large number of connections

    Aleš Bregar Newbie



      doing a server push(comet style) technology on top of jbossweb 7.0.3(from jboss 7.1.0.BETA1b) kills a service I think. I have tried to use Servlet 3.0 ASYNC and store all the opened connections as asynccontexts inside some hashmap. When reaching magic number 32768 of simultaneous open connections, service throws


      16:04:25,281 ERROR [org.apache.tomcat.util.net.JIoEndpoint] (http-- Unexpected poller error: java.lang.ArrayIndexOutOfBoundsException: 32768
              at org.apache.tomcat.util.net.JIoEndpoint$SocketTimeouts.add(JIoEndpoint.java:390) [jbossweb-7.0.3.Final.jar:]
              at org.apache.tomcat.util.net.JIoEndpoint$Poller.run(JIoEndpoint.java:780) [jbossweb-7.0.3.Final.jar:]
              at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]


      Cpu usage is near 0%, heap consumption is acceptable (as I observe it is something like ~110kB/connection), just this error obstacles my goal to reach 100k conn/server.


      Also if I shutdown server from the state above, it does not shutdown cleanly - with some 'JBAS010151: Unable to get transaction state: java.lang.IllegalStateException', please see more log attached.



      Maybe also another question - what would be preferable to do if one would want to implement server push tech on top of java - should the jbossweb 7.0.x(with async servlet 3.0) be used or some plain netty 3.2.x based service should be implemented? IMO I see the jbossweb benefits by natively supporting ssl, rest, ouath and other filters but con is also a drawback with more resource consumption?


      Thanks in advance on looking into this,