Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#563 closed defect (duplicate)

API seems slow to close connection after return 410 GONE

Reported by: jburgess@… Owned by: Tom Hughes
Priority: minor Milestone:
Component: api Version:
Keywords: Cc:


I noticed that an API query which results in a 410 GONE seems slow. It actually prints the response lines within a fraction of a second but then sits there for 5 seconds before returning. Looking at a packet trace in Wireshark shows that there is a 5 second pause between sending the response and the final FIN being sent by the web server. For API requests which return OK(200) & data there is no such delay.

Something which may be related is it returns Content-length: 1, which is odd seeing as there is no data returned. Perhaps rails or lighttpd is confused for 5 seconds waiting for some content?

$ time wget -O /dev/null -S ""
           => `/dev/null'
Connecting to||:80... connected.
HTTP request sent, awaiting response... 
  HTTP/1.0 410 Gone
  Connection: keep-alive
  Content-Type: text/html; charset=utf-8
  Cache-Control: no-cache
  Content-Length: 1
  Date: Tue, 16 Oct 2007 22:51:55 GMT
  Server: lighttpd/1.4.13
23:08:44 ERROR 410: Gone.

real    0m5.636s
user    0m0.000s
sys     0m0.003s

Change History (3)

comment:1 Changed 13 years ago by Tom Hughes

It's wget that is waiting for content - this is a bug in either rails or lighttpd (probably rails) where it sends a content length of one but no content when it was told to send no content. There isn't much I can do about it I'm afraid.

comment:2 Changed 13 years ago by Tom Hughes

Resolution: duplicate
Status: newclosed

Duplicate of #537.

comment:3 Changed 13 years ago by jburgess@…

I still get content-length:1 when I run against a local WEBrick instance but do not suffer the 5 second delay. I understand this doesn't change the resolution but it points towards the delay being due to lighttpd (even if the trigger may be the bad content-length).

$ wget -O /dev/stdout -S "http://localhost:3000/api/0.5/way/35"
--00:59:34--  http://jburgess%40localhost.localdomain:*password*@localhost:3000/api/0.5/way/35
           => `/dev/stdout'
Resolving localhost...
Connecting to localhost||:3000... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 410 Gone
  Cache-Control: no-cache
  Connection: Keep-Alive
  Date: Tue, 16 Oct 2007 23:59:34 GMT
  Content-Type: text/html; charset=utf-8
  Server: WEBrick/1.3.1 (Ruby/1.8.6/2007-09-24)
  Content-Length: 1
00:59:34 ERROR 410: Gone.
Note: See TracTickets for help on using tickets.