Agent HTTP requests getting stuck?

I have found that sometimes I will do an HTTP Get and the agent will go completely out to lunch.
Either it never receives it (when it worked 1 minute ago), or I never get the response. Eventually the connection times out with

curl: (52) Empty reply from server

It is possible that I have errant code flooding with requests (I am looking into that), but I see no log or indication of such. Any ideas?

We’re looking into this; there are improvements (and more debuggability on our side) coming, likely in the next week.

When this happens, how do you get things working again? Is it just a single request going missing?

YEs same here…
Tue Jun 25 2013 09:01:24 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:01:25 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:02:24 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:02:24 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:03:24 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:03:24 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:04:24 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:04:25 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:05:24 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:05:25 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:06:24 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:06:25 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:07:24 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:07:24 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:08:24 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:08:25 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:09:24 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:09:25 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:10:24 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:10:24 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:11:24 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:11:25 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:12:24 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:12:25 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:13:28 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:13:29 GMT-0300 (Hora oficial do Brasil): 0001

I’m not sure what that log is saying, apart from “0001”. Can you explain a bit?

My app dont get status anymore… i go out of app, at 09:15 and the Imp continius send status becouse the connection is stuck.

Tue Jun 25 2013 09:16:24 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:16:25 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:17:25 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:17:25 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:18:25 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:18:25 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:19:28 GMT-0300 (Hora oficial do Brasil): 0001
Tue Jun 25 2013 09:19:29 GMT-0300 (Hora oficial do Brasil): 0001

Yes… the 0001 is the status my iphone app send a repeated request at 5 sec and imps send the status of hardware (port 0, port 1, port 2 , port 3) 0001

Again, this isn’t helping very much. To debug an issue, we need more detail:

  • agent code (is this http in or out?)
  • what it’s talking to
  • expected behavior
  • etc

…it’s quite possible to have issues due to bugs in agent code.

Ok…
my iphone app send a repeated request at 5-5 sec and imps send the status of hardware (port 0, port 1, port 2 , port 3) 0001 response.
Today, im sending a request and its 1-1 min response… like a log i posted…
Agent code: 2363a4b236a7c9ee

Sorry about my english… =(

Sometimes the response is lost, and never come to my app.

Ok, so this stems back to my efficient update mechanism I am trying to do…

The client requests updated data with an updateNumber (say 1), if the agents update number is not 1, the agent sends back JSON including the current updateNumber (say 2).

Next time it requests update number 2. Since it matches what the agent has, it stores that request. Next time something changes on the agent, it bumps the update number and responds to the request with the data.

Many times, there isn’t an update for X number of seconds, in that case, the client gets a timeout (-1001). It simply just makes the request again. When this happens, the agent tosses the previous request.

Of course, this saved request gets stale when it times out I have this stale request saved (until my app comes and requests more updates).

My app just went out of this state, I am not sure if it is because things magically caught up, or if my change in my app fixed it.

I think it couse becouse im in 3g connection from brasil(very slow), and i send a lot of requests, and i dont get a response yet… It stuck the conncetion of imp and 1-1 minute the server response the request stuck, now its normalized becouse the server response all requests. Like a pool…
I think I can solve this problem by treating the app to check the status only when i have server response, so then the app check the status again. but what is happened when i got 5 persons using same imp server?

If you’re using 3G on a phone, and have a delay bigger than maybe 7-10 seconds between requests, then your 3G connection will likely be dropped onto a paging channel. This means, when the next request is made by the phone, the lower layers of 3G have to move onto a communications channel.

This process can easily take 5 seconds (it’s usually about 2-3), and would explain why you see two requests with the same timestamp on the imp - they have been buffered in the phone’s TCP buffers waiting for 3G to come up.

If you kept requesting every 5 seconds, you’d likely see the timestamps 5 seconds apart because the network would not see your 3G device as idle.

Ok! i will work on it tonight resolving the issue on my app, an then i post here.
tanks man!