On Mon, Jan 30, 2012 at 5:46 PM, Karthik K <[email protected]> wrote: > On Mon, Jan 30, 2012 at 5:20 PM, Mohit Anchlia <[email protected]>wrote: > >> On Mon, Jan 30, 2012 at 2:07 PM, Karthik K <[email protected]> wrote: >> > We would still need to release the http connections and the resources for >> > the http response. >> > >> > See the patch for HTTPCLIENT-1159 for details: ( 1) shutting down >> > connection manager and 2) closing stream of http entity as part of >> response >> > ). >> >> Few follow up questions: >> >> 1) shutdown is required only when shutting down the app, correct? I >> mean is shutdown is required after every http request? >> > > True. shutdown of a (http)client is a 1-time effort ( depending on the > connection manager, assuming that it is thread-safe). > > > >> 2) I am using EntityUtils.toByteArray(entity), So how do I close the >> stream in this case? >> > > entity has an InputStream in it, and you can 'consumeContent' off the same. > > I looked at the code of EntityUtils and it looks like it is already closing the inputStream. So do I still need to consume it after calling EntityUtils.toByteArray(entity)? I am little confused here. Looks like I don't need to call consume.
> >> >> > >> > While the patch comes in 4.2 in the future, we need to do the equivalent >> of >> > the same when releasing connections though, for httpclient < 4.2 . >> > >> > -- >> > Karthik. >> > >> > >> > On Mon, Jan 30, 2012 at 9:35 AM, Mohit Anchlia <[email protected] >> >wrote: >> > >> >> I am using 4.1.2 and I see that releaseConnection on specific >> >> put/post/get/delete was removed since 3.1. Do I still have a need to >> >> release connection? >> >> >> >> On Sat, Jan 28, 2012 at 10:34 AM, Mohit Anchlia <[email protected] >> > >> >> wrote: >> >> > I found that we are not calling releaseConnection and I think it's >> >> > somehow related to that. But it still doesn't explain the below >> >> > behaviour where B responded 10 secs before A timedout. Is this some >> >> > kind of a race condition when releaseConnection is not called? >> >> > >> >> > On Fri, Jan 27, 2012 at 4:07 PM, Mohit Anchlia < >> [email protected]> >> >> wrote: >> >> >> We are seeing a wierd behaviour and I am wondering if some kind of >> >> >> session stickyness might be in play. >> >> >> >> >> >> We use HttpClient in Jboss to send post request from A -> B, then B >> -> >> >> >> replies with 404 but after 15 secs (timeout on the request) we get >> >> >> below timeout even though B -> replied to A in few millisecs. I can >> >> >> see in B (apache) logs that response was sent in few ms. So don't >> >> >> understand what is causing the timeout and why. >> >> >> >> >> >> java.net.SocketTimeoutException: Read timed out >> >> >> at java.net.SocketInputStream.socketRead0(Native Method) >> >> >> at java.net.SocketInputStream.read(SocketInputStream.java:129) >> >> >> at >> >> com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293) >> >> >> at >> >> com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331) >> >> >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: [email protected] >> >> For additional commands, e-mail: [email protected] >> >> >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
