Note that there are some explanatory texts on larger screens.

plurals
  1. POHttpClient stalls for long periods of time, even with timeout parameters set
    primarykey
    data
    text
    <p>I have an app that is doing a non trivial amount of downloading of thumbnail images and other resources from a remote service.</p> <p>I'm using a single instance of DefaultHttpClient and a custom class that I wrote that schedules all of my downloads. All downloading is run in serial on background threads via AsyncTask. I don't re-run my download routine until onPostExecute gets executed in the AsyncTask.</p> <p>This often works perfectly. If I queue up 20 images, my scheduler does its thing just fine. However, I run into cases where the procedure just stalls at the point of calling client.execute (where client is my instance of DefaultHttpClient). I can inexplicably resuscitate the process by navigating around the app and doing random actions (scrolling a list, navigating back and forth between activities, etc). <strong>It's as if something I'm doing is sending a "wake up" message to a thread that has stalled or deadlocked.</strong></p> <p>I've added an obnoxious amount of logging at all moving parts of my application to see if something external to this procedure is causing some kind of deadlock condition. I view LogCat by pid to see if anything else is happening in my process at the point of stalling or at the point of resuming, and I don't see anything whatsoever out of the ordinary. The weirdest part about this is that I can duplicate the exact condition over and over.</p> <p>FWIW, I have set socket timeouts and connection timeouts on both the HttpClient instance and the HttpGet instance that I pass to the execute method. This does not cause the execute method to return early or throw an exception or anything like that. When the procedure "kicks back in", HttpClient.execute returns a valid HttpResponse and everything operates as normal.</p> <p>Any ideas on things I can debug to find out where this is getting tripped up? I recognize that this is a very specific condition, but <strong>are there any advanced methods for specifically debugging DefaultHttpClient or http traffic in Android in general?</strong></p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload