Bug 4280 - Python tracebacks serving web requests: AttributeError: 'hgweb' object has no attribute 'maxshortchanges'
Summary: Python tracebacks serving web requests: AttributeError: 'hgweb' object has no...
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: hgweb (show other bugs)
Version: 3.0.1
Hardware: PC Linux
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-12 20:16 UTC by Ben Kero
Modified: 2014-07-19 14:17 UTC (History)
2 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Kero 2014-06-12 20:16 UTC
This problem appears if I start a siege against http://localhost:8000/ before starting 'hg serve'. I think this means that it's accepting and attempting to serve content before all the data structures have been loaded and are ready.

The issue isn't reproducible if the server has had time to spin itself up. If you're trying to reproduce, be sure to start the siege first.

bkero@Triumph:~/code/mercurial-repo$ ./hg serve
listening at http://Triumph:8000/ (bound to *:8000)
127.0.0.1 - - [12/Jun/2014 17:10:49] "GET / HTTP/1.1" 500 -
127.0.0.1 - - [12/Jun/2014 17:10:49] Exception happened during processing request '/':
Traceback (most recent call last):
  File "/home/bkero/code/mercurial-repo/mercurial/hgweb/server.py", line 80, in do_POST
    self.do_write()
  File "/home/bkero/code/mercurial-repo/mercurial/hgweb/server.py", line 73, in do_write
    self.do_hgweb()
  File "/home/bkero/code/mercurial-repo/mercurial/hgweb/server.py", line 140, in do_hgweb
    for chunk in self.server.application(env, self._start_response):
  File "/home/bkero/code/mercurial-repo/mercurial/hgweb/hgweb_mod.py", line 136, in __call__
    return self.run_wsgi(req)
  File "/home/bkero/code/mercurial-repo/mercurial/hgweb/hgweb_mod.py", line 249, in run_wsgi
    content = getattr(webcommands, cmd)(self, req, tmpl)
  File "/home/bkero/code/mercurial-repo/mercurial/hgweb/webcommands.py", line 347, in shortlog
    return changelog(web, req, tmpl, shortlog=True)
  File "/home/bkero/code/mercurial-repo/mercurial/hgweb/webcommands.py", line 311, in changelog
    revcount = shortlog and web.maxshortchanges or web.maxchanges
AttributeError: 'hgweb' object has no attribute 'maxshortchanges'
Comment 1 HG Bot 2014-06-18 22:00 UTC
Fixed by http://selenic.com/repo/hg/rev/bd3360c63bb3
Matt Mackall <mpm@selenic.com>
hgweb: avoid initialization race (issue4280)

(please test the fix)