MediaWiki r52190 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r52189‎ | r52190 (on ViewVC)‎ | r52191 >
Date:08:10, 20 June 2009
Author:catrope
Status:reverted (Comments)
Tags:
Comment:
API: Return HTTP 503 status code on maxlag error, like index.php does
Modified paths:

Diff [purge]

Loading diff…

Follow-up revisions

Rev.Commit summaryAuthorDate
r53353Revert r52190 ("Return HTTP 503 on API maxlag error"): announcement prompted ...catrope08:04, 16 July 2009

Comments

#Comment by Mr.Z-man (talk | contribs)   15:14, 20 June 2009

Note that this could be a breaking change for some clients. Python urllib/urllib2 for example raises an exception on 503 errors by default.

#Comment by Catrope (talk | contribs)   15:18, 20 June 2009

Good point, I'll announce it on the mailing list.

#Comment by Anomie (talk | contribs)   17:20, 30 June 2009

Don't forget to send that announcement. Unless our IRC conversation a few days ago changed your mind. ;)

For anyone else: While this change makes sense from one viewpoint, it doesn't from what is IMO a better view. index.php returns 503 because in the HTTP protocol that's how you indicate an error. But the API isn't HTTP, it just uses HTTP as a transport and reports its errors inside a successful HTTP response. This change basically raises API maxlag from "normal API error" to "transport-layer error", which could be considered equivalent to index.php sending an ICMP error on maxlag.

#Comment by R'n'B (talk | contribs)   13:59, 15 July 2009

I still haven't seen any announcement of this on the mailing list. Besides knowing that maxlag will throw an HTTP 503 status code, it would be helpful to know what the content of the message body will be, so that this can be distinguished from other 503 conditions (squid errors).

Status & tagging log