Modify

Opened 3 years ago

Last modified 2 months ago

#22138 new enhancement

Parse and use the status element in OpenStreetMap GET /api/capabilities

Reported by: taylor.smock Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: capabilities Cc:

Description

It would be nice to be able to show the user a better message when a timeout occurs.

To that end, we can use the osmwiki:API_v0.6#Capabilities:_GET_/api/capabilities call. Specifically, <status database="online" api="online" gpx="online"/>.

The status element returns either online, readonly or offline for each of the database, API and GPX API. The database field is informational, and the API/GPX-API fields indicate whether a client should expect read and write requests to work (online), only read requests to work (readonly) or no requests to work (offline).

If readonly or offline, then we should refuse upload/download for a short set amount of time (e.g. 30 seconds), and check if the api's are back up.

Attachments (0)

Change History (7)

comment:1 by GerdP, 3 years ago

Do you want to use that call after a timeout occured?

comment:2 by taylor.smock, 3 years ago

Pretty much, yes. I'm going to have to play around with it a bit, but after this morning's OSM API outage, I thought it might be a good thing to have, if only so users know that there are currently issues.

We could also offer to do an overpass query (nwr({{bbox}});) if the API is down, so that users can still edit, even if they cannot upload.

comment:3 by GerdP, 3 years ago

I've done a few edit sessions during the last weeks and on some days I got lot's of timeouts, but only when I tried to upload, and almost always a quick 2nd attempt worked fine. This happened with the windows package and I think the azul JRE is the culprit because I can't remember those problems with other JREs.

comment:4 by taylor.smock, 3 years ago

I don't know about the upload timeouts. I'll have to see if I can reproduce on Mac/Linux (except it isn't consistent, so it will be hit and miss).

But I was talking about this. Which was an overall OSM API outage (see also OSM_Tech on Twitter).

Anyway, from TomH on #osm-dev IRC (when discussing using the /capabilities call for checking server status):

capabilities is no better or worse than anything else, except that I think it hits rails rather than cgimap so will hit a rails queue

comment:5 by mmd, 3 years ago

on some days I got lot's of timeouts, but only when I tried to upload,

Which endpoint was this specifically? Creating the changeset (=handled by Rails ports), or uploading the changeset (=handled by CGImap)?

/capabilities is handled by the Rails port, it won't tell you anything about CGImap (nor, if there will be an issue with either creating a changeset or uploading some data).

comment:6 by taylor.smock, 3 years ago

Well, with the current outage, I'm getting

<osm version="0.6" generator="OpenStreetMap server" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
<api>
<version minimum="0.6" maximum="0.6"/>
<area maximum="0.25"/>
<note_area maximum="25"/>
<tracepoints per_page="5000"/>
<waynodes maximum="2000"/>
<relationmembers maximum="32000"/>
<changesets maximum_elements="10000"/>
<timeout seconds="300"/>
<status database="readonly" api="readonly" gpx="readonly"/>
</api>
<policy>
<imagery>
<blacklist regex=".*\.google(apis)?\..*/.*"/>
<blacklist regex="http://xdworld\.vworld\.kr:8080/.*"/>
<blacklist regex=".*\.here\.com[/:].*"/>
</imagery>
</policy>
</osm>

So it might be useful even if even if the original reason isn't applicable.

comment:7 by gaben, 16 months ago

Keywords: capabilities added

Also it would be nice if the API capabilities would be used more instead of hardcoding like josm/trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java?rev=18801#L37.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to taylor.smock.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.