Last modified: 2011-03-13 18:04:54 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T21572, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 19572 - API list=embeddedin times out when namespace specified
API list=embeddedin times out when namespace specified
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Lowest major (vote)
: ---
Assigned To: Roan Kattouw
http://en.wikipedia.org/w/api.php
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-07 21:36 UTC by Misza
Modified: 2011-03-13 18:04 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Misza 2009-07-07 21:36:41 UTC
I discovered this accidentally while rewriting my archiving bot to use the API.

It gets its list of pages by examining transclusions of a particular template. Thus, we start with http://en.wikipedia.org/w/api.php?format=jsonfm&einamespace=5&list=embeddedin&eititle=User:MiszaBot/config&eilimit=100&action=query - this is for the 'Wikipedia talk:' namespace.

This should work fine; we get "eicontinue": "2|MiszaBot\/config|2072126", so let's continue on to the next batch: http://en.wikipedia.org/w/api.php?format=jsonfm&einamespace=5&list=embeddedin&eititle=User:MiszaBot/config&eilimit=100&action=query&eicontinue=2|MiszaBot/config|2072126

Which may or may not work for you when you try it; if it does, try following the next eicontinue. At some point (especially with "cold index cache", I presume; which is why it's not reliably reproducible), it may choke and (after a minute or so of waiting) you get a Wikimedia error page (in HTML, not JSON, so the parser freaks out) from a squid explaining that an ERR_READ_TIMEOUT occured.

I wouldn't be too hasty attributing this to the squids, because I've seen it happen even while going 10 results per request (which really shouldn't take that long).

Oddly, there are no problems when I just omit einamespace and filter in my program based on the "ns" parameter of the yielded pages.
Comment 1 Roan Kattouw 2009-07-07 21:42:12 UTC
This works for me, I don't get any timeouts until I reach the end. I'll take a look at the query it runs, though.
Comment 2 Roan Kattouw 2009-07-07 22:03:46 UTC
It seems that blnamespace/einamespace is implemented inefficiently, which causes the timeout. I won't remove it, though, because the UI also allows such queries. Closing as WONTFIX unless someone authoritative says this needs to go. 
Comment 3 Misza 2009-07-07 22:24:07 UTC
What do you mean by "implemented inefficiently"? (Sorry, I'm a n00b with the MediaWiki query building framework.)

To me, it seems like just another condition in the WHERE clause. Maybe this hint causes MySQL to use an inefficient query plan? Just guessing...

Anyway, if the UI can do it without stalling, then so should the API (and not for a moment did I consider removing it completely). Until then, it somewhat impairs functionality, so this should be left open (or reassigned to other component, if you can confirm it's a schema/index issue).
Comment 4 Roan Kattouw 2009-07-07 22:32:26 UTC
(In reply to comment #3)
> What do you mean by "implemented inefficiently"? (Sorry, I'm a n00b with the
> MediaWiki query building framework.)
> 
> To me, it seems like just another condition in the WHERE clause. Maybe this
> hint causes MySQL to use an inefficient query plan? Just guessing...
> 
Yes.

> Anyway, if the UI can do it without stalling, then so should the API (and not
> for a moment did I consider removing it completely). Until then, it somewhat
> impairs functionality, so this should be left open (or reassigned to other
> component, if you can confirm it's a schema/index issue).
> 

Both run the exact same query. If the API stalls because of the query, the UI will too.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links