4 Replies Latest reply on Sep 16, 2015 9:22 AM by Stuart Douglas

    ServletInputStream thread stuck in undertow handler of jboss wildfly 8.2.0 final?

    Ronnie Max Newbie

      I'm trying to send a file in the body of a POST request to my servlet deployed in wildfly 8.2.0. In my code I'm trying to read the file stream from request into ServletInputStream object using request.getInputStream(). This works fine in Jboss 7.X. On Wildfly 8.2.0, the undertow's servlet handler seems to be kicking in. I see that file stream was completely transferred to the ServletInputStream object. But undertow doesn't seem to be releasing its thread even after 100% transfer. Not sure if its a bug in undertow or something I have configured wrongly in the undertow module. Any suggestions here?

      Here is the details of the thread that has been stuck even after 100% transfer:


      default task-17

      sun.nio.ch.PollArrayWrapper.poll0(Native Method)

      sun.nio.ch.PollArrayWrapper.poll(PollArrayWrapper.java:117)

      sun.nio.ch.PollSelectorImpl.doSelect(PollSelectorImpl.java:73)

      sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87)

      sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98)

      sun.nio.ch.SelectorImpl.select(SelectorImpl.java:102)

      org.xnio.nio.SelectorUtils.await(SelectorUtils.java:46)

      org.xnio.nio.NioSocketConduit.awaitReadable(NioSocketConduit.java:345)

      org.xnio.conduits.AbstractSourceConduit.awaitReadable(AbstractSourceConduit.java:66)

      io.undertow.conduits.ReadDataStreamSourceConduit.awaitReadable(ReadDataStreamSourceConduit.java:101)

      io.undertow.server.protocol.ajp.AjpServerRequestConduit.awaitReadable(AjpServerRequestConduit.java:278)

      org.xnio.conduits.ConduitStreamSourceChannel.awaitReadable(ConduitStreamSourceChannel.java:151)

      io.undertow.channels.DetachableStreamSourceChannel.awaitReadable(DetachableStreamSourceChannel.java:77)

      io.undertow.server.HttpServerExchange$ReadDispatchChannel.awaitReadable(HttpServerExchange.java:1997)

      org.xnio.channels.Channels.readBlocking(Channels.java:295)

      io.undertow.servlet.spec.ServletInputStreamImpl.readIntoBuffer(ServletInputStreamImpl.java:170)

      io.undertow.servlet.spec.ServletInputStreamImpl.read(ServletInputStreamImpl.java:146)

      io.undertow.servlet.spec.ServletInputStreamImpl.read(ServletInputStreamImpl.java:133)

      javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

      javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

      io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86)

      io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130)