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'
Fixed by http://selenic.com/repo/hg/rev/bd3360c63bb3 Matt Mackall <mpm@selenic.com> hgweb: avoid initialization race (issue4280) (please test the fix)