Page MenuHomePhabricator

high lag during log initialisation
Closed, ResolvedPublic

Description

If initialisation is going to be slowed down due to server lag, the user should be informed.

$ python pwb.py featured
Sleeping for 120.0 seconds, 2014-08-01 11:02:01
^CTraceback (most recent call last):

File "pwb.py", line 143, in <module>
  run_python_file(fn, argv, argvu)
File "pwb.py", line 67, in run_python_file
  exec(compile(source, filename, "exec"), main_mod.__dict__)
File "scripts/featured.py", line 622, in <module>
  main()
File "scripts/featured.py", line 603, in main
  for arg in pywikibot.handleArgs():
File ".../pywikibot/bot.py", line 648, in handleArgs
  init_handlers()
File ".../pywikibot/bot.py", line 242, in init_handlers
  writelogheader()
File ".../pywikibot/bot.py", line 274, in writelogheader
  log(u'SITE VERSION: %s' % unicode(site.live_version()))
File ".../pywikibot/site.py", line 1278, in live_version
  versionstring = self.siteinfo['generator']
File ".../pywikibot/site.py", line 1184, in siteinfo
  self._getsiteinfo()
File ".../pywikibot/site.py", line 1116, in _getsiteinfo
  sidata = sirequest.submit()
File ".../pywikibot/data/api.py", line 505, in submit
  self._data = super(CachedRequest, self).submit()
File ".../pywikibot/data/api.py", line 405, in submit
  self.site.throttle.lag(int(lag.group("lag")))
File ".../pywikibot/throttle.py", line 310, in lag
  time.sleep(wait)

KeyboardInterrupt
<type 'exceptions.KeyboardInterrupt'>
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort

Ideally, server version should be fetched and logged asynchronously.

This is similar to the repo log version, for which was added a config var to bypass. (log_pywiki_repo_version = False)


Version: core-(2.0)
Severity: normal

Details

Reference
bz68986

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:26 AM
bzimport set Reference to bz68986.
bzimport added a subscriber: Unknown Object (????).
jayvdb claimed this task.
jayvdb edited projects, added Pywikibot; removed Pywikibot-General.
jayvdb set Security to None.
jayvdb removed a subscriber: Unknown Object (????).

The log initialisation no longer uses the site version.