[Mediawiki-api] [Mediawiki-api-announce] BREAKING CHANGE: HTTP 503 status code for maxlag errors

Carl (CBM) cbm.wikipedia at gmail.com
Wed Jul 15 23:39:01 UTC 2009


On Wed, Jul 15, 2009 at 5:30 PM, Roan Kattouw<roan.kattouw at gmail.com> wrote:

> As of r52190 [1], API maxlag errors (the kind of error you get when
> you set &maxlag=2 and the maximum slave lag is higher than two
> seconds) return a HTTP 503 status code rather than a 200, for
> consistency with index.php (which does the same thing). The text of
> the response has not changed:
>
> <api>
>  <error code="maxlag" info="Waiting for 10.0.6.38: 1 seconds lagged" />
> </api>

If this is a 503 error, can't we set an HTTP header with the retry
delay? Otherwise this adds yet another complexity to error handling.
Index.php sets "Retry-After" and "X-Database-Lag" headers when maxlag
is exceeded, via wfMaxlagError().

- Carl



More information about the Mediawiki-api mailing list