Error when pulling while a concurrent request obsoletes a head
Got an error 500 while simply pulling with HTTPS on octobus/mercurial-devel
. That was after a couple of weeks of inactivity, the obsmarker discovery took a while and someone was pushing in concurrency.
The error ended up in gunicorn.log
:
[2020-08-21 15:13:00 +0000] [2732402] [ERROR] Error handling request /octobus/mercurial-devel.hg?cmd=getbundle
Traceback (most recent call last):
File "/home/hg/venv3/lib/python3.8/site-packages/gunicorn/workers/sync.py", line 134, in handle
self.handle_request(listener, req, client, addr)
File "/home/hg/venv3/lib/python3.8/site-packages/gunicorn/workers/sync.py", line 180, in handle_request
for item in respiter:
File "/home/hg/venv3/lib/python3.8/site-packages/heptapod/wsgi.py", line 126, in __call__
for r in self._runwsgi(env, respond):
File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/hgweb/hgweb_mod.py", line 326, in run_wsgi
for r in self._runwsgi(req, res, repo):
File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/hgweb/hgweb_mod.py", line 352, in _runwsgi
handled = wireprotoserver.handlewsgirequest(
File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/wireprotoserver.py", line 233, in handlewsgirequest
_callhttp(repo, req, res, proto, cmd)
File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/wireprotoserver.py", line 469, in _callhttp
rsp = wireprotov1server.dispatch(repo, proto, cmd)
File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/wireprotov1server.py", line 82, in dispatch
return func(repo, proto, *args)
File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/wireprotov1server.py", line 492, in getbundle
info, chunks = exchange.getbundlechunks(
func(
File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/exchange.py", line 2540, in _getbundlechangegrouppart
if not outgoing.missing:
File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/util.py", line 1745, in __get__
result = self.func(obj)
File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/discovery.py", line 135, in missing
self._computecommonmissing()
File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/discovery.py", line 121, in _computecommonmissing
sets = self._revlog.findcommonmissing(
File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/revlog.py", line 1008, in findcommonmissing
heads = [self.rev(n) for n in heads]
File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/revlog.py", line 1008, in <listcomp>
heads = [self.rev(n) for n in heads]
File "/home/hg/venv3/lib/python3.8/site-packages/mercurial/repoview.py", line 325, in rev
raise error.FilteredLookupError(
mercurial.error.FilteredLookupError: b'00changelog.i@843927d743eb6f62a24e187d4dd92181ae9e0f8f: filtered node'
I've seen the concurrent push in the logs. It really looks as if a head found by the discovery process has been obsoleted in the mean time.
On the Heptapod side, we certainly should do more catching and perhaps give the user a nicer message, proposing to retry (that would be ultimately in py-heptapod's WSGI wrapper). In any case, this shouldn't end up in gunicorn.log
.
I'm not sure what would have happened over SSH. In other words, should this be also considered a Mercurial issue?