##// END OF EJS Templates
hgweb: consume generator inside context manager (issue4756)...
hgweb: consume generator inside context manager (issue4756) If code inside a context manager returns a generator, the context manager exits before the generator is iterated. hgweb was using a context manager to control thread safe access to a localrepository instance. But it was returning a generator, so there was a race condition between a previous request streaming a response to the client and a new request obtaining the released but in use repository. By iterating the generator inside the context manager, we ensure we don't release the repo instance until after the response has finished. With this change, hgweb finally appears to have full localrepository isolation between threads. I can no longer reproduce the 2 exceptions reported in issue4756. test-hgweb-non-interactive.t has been modified to consume the output of calling into a WSGI application. Without this, execution of the WSGI application stalls because of the added yield statement.

File last commit:

r21056:d7070395 default
r26247:7df5d476 default
Show More
map
19 lines | 596 B | text/plain | TextLexer
default = 'changelog'
feedupdated = '<updated>{date|rfc3339date}</updated>'
mimetype = 'application/atom+xml; charset={encoding}'
header = header.tmpl
changelog = changelog.tmpl
changelogentry = changelogentry.tmpl
filelog = filelog.tmpl
filelogentry = filelogentry.tmpl
tags = tags.tmpl
tagentry = tagentry.tmpl
bookmarks = bookmarks.tmpl
bookmarkentry = bookmarkentry.tmpl
branches = branches.tmpl
branchentry = branchentry.tmpl
error = error.tmpl
filedifflink = '{file|escape}<br />'
fileellipses = '{file|escape}<br />'
filenodelink = '{file|escape}<br />'
filenolink = '{file|escape}<br />'