Last modified: 2012-02-18 18:07:12 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 T36029, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34029 - Infinite loop in API blocklist
Infinite loop in API blocklist
Status: RESOLVED DUPLICATE of bug 24782
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.18.x
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-30 00:15 UTC by wikiposta
Modified: 2012-02-18 18:07 UTC (History)
8 users (show)

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


Attachments
Source from pastebin (774 bytes, text/plain)
2012-02-01 15:34 UTC, Mark A. Hershberger
Details

Description wikiposta 2012-01-30 00:15:04 UTC
Querying API blocklist may result in an infinite loop if there are more blocks in the same second than given bklimit.

Test to reproduce: try query blocklist of Hungarian Wikipedia by 5 blocks. At 2010-03-05T17:52:44Z it will get into an infinite loop because there are 7 blocks at that second (from block id 6456 to 6462).

Use ctrl F here: https://hu.wikipedia.org/w/api.php?action=query&list=blocks&bklimit=1000

My code using Pywikipedia: http://pastebin.com/7UU0bT4f
Comment 1 wikiposta 2012-01-30 08:25:18 UTC
An additional problem: the smaller limit you use, the greater is the possibility to get fake duplicates. E.g. block id=n and block id=n+1 have the same timestamp, end the first run ends with nth. You get back a timestamp for n+1st item, but using it will display nth item repeatedly. So every query is subject to have duplicates.

The easy solution would be to use block id instead of bkstart in query-continue.
Comment 2 Mark A. Hershberger 2012-02-01 15:34:00 UTC
Created attachment 9939 [details]
Source from pastebin

Made the source an attachment here.
Comment 3 Mark A. Hershberger 2012-02-01 15:50:49 UTC
https://hu.wikipedia.org/w/api.php?action=query&list=blocks&bklimit=7&bkstart=1267811564 -- better link to the example blocklist
Comment 4 db [inactive,noenotif] 2012-02-18 18:07:12 UTC

*** This bug has been marked as a duplicate of bug 24782 ***

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


Navigation
Links