Page MenuHomePhabricator

Infinite loop in API blocklist
Closed, ResolvedPublic

Description

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


Version: 1.18.x
Severity: normal

Details

Reference
bz34029
TitleReferenceAuthorSource BranchDest Branch
Draft: backport.py: Restore included_in branches checkrepos/releng/scap!270jhuneidiT360291-2master
backport: use more informative message for configuration backportsrepos/releng/scap!250jnucheT360291master
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:09 AM
bzimport set Reference to bz34029.
bzimport added a subscriber: Unknown Object (MLST).

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.

Created attachment 9939
Source from pastebin

Made the source an attachment here.

Attached:

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