Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

API seems slow to close connection after return 410 GONE #563

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments
Closed

API seems slow to close connection after return 410 GONE #563

openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments

Comments

@openstreetmap-trac
Copy link

Reporter: jburgess[at]uklinux.net
[Submitted to the original trac issue database at 7.30pm, Tuesday, 16th October 2007]

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 "http://www.openstreetmap.org/api/0.5/relation/2163"
--23:08:38--  http://www.openstreetmap.org/api/0.5/relation/2163
           => `/dev/null'
Resolving www.openstreetmap.org... 128.40.58.202
Connecting to www.openstreetmap.org|128.40.58.202|: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
@openstreetmap-trac
Copy link
Author

Author: tom[at]compton.nu
[Added to the original trac issue at 11.36pm, Tuesday, 16th October 2007]

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.

@openstreetmap-trac
Copy link
Author

Author: tom[at]compton.nu
[Added to the original trac issue at 11.36pm, Tuesday, 16th October 2007]

Duplicate of #537.

@openstreetmap-trac
Copy link
Author

Author: jburgess[at]uklinux.net
[Added to the original trac issue at 12.04am, Wednesday, 17th October 2007]

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... 127.0.0.1
Connecting to localhost|127.0.0.1|: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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant