Hi All, The application we are developing has a sender which pushes indefinite binary data to the web application hosted in Tomcat. The web application is supposed to consumes an un-predefined limit of data per connection and stop.
The sender is implemented using Http client and uses InputStreamEntitiy with chunked encoding. It pushes the data to a PushServlet on the server. The after PushServlet is done consuming data, it returns from the doPost(). But the client keeps running because Tomcat as such does not close the stream. Analyzing the thread dump reveals that it is stuck in cleanup where it tries to read out the input stream. Following stacktrace talks more where exactly it gets stuck. java.net.SocketInputStream.socketRead0(Native Method) java.net.SocketInputStream.read(SocketInputStream.java:129) org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:747) org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:777) org.apache.coyote.http11.filters.ChunkedInputFilter.readBytes(ChunkedInputFilter.java:225) org.apache.coyote.http11.filters.ChunkedInputFilter.parseCRLF(ChunkedInputFilter.java:293) org.apache.coyote.http11.filters.ChunkedInputFilter.doRead(ChunkedInputFilter.java:125) org.apache.coyote.http11.filters.ChunkedInputFilter.end(ChunkedInputFilter.java:179) org.apache.coyote.http11.InternalInputBuffer.endRequest(InternalInputBuffer.java:368) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:881) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) java.lang.Thread.run(Thread.java:619) Is this a bug? If not what is the right way to solve it? Is this related to the Expect: 100 continue mechanism? Thanks, Santosh.