forgejo/modules
zeripath 858c35b731
Ensure BlameReaders close at end of request (#12102)
#11716 reports multiple git blame processes hanging around
this was thought to be due to timeouts, however on closer look this
appears to be due to the Close() function of the BlameReader hanging
with a blocked stdout pipe.

This PR fixes this Close function to:

* Cancel the context of the cmd
* Close the StdoutReader - ensuring that the output pipe is closed

Further it makes the context of the `git blame` command a child of the
request context - ensuring that even if Close() is not called, on
cancellation of the Request the blame is command will also be cancelled.

Fixes #11716
Closes #11727

Signed-off-by: Andrew Thornton <art27@cantab.net>
2020-07-01 14:01:17 +01:00
..
analyze
auth
avatar
base
cache
charset
context
convert
cron
emoji
eventsource
generate
git
gitgraph
graceful
highlight
httplib
indexer
lfs
log
markup
metrics
migrations
notification
options
password
pprof
private
process
public
queue
recaptcha
references
repofiles
repository
secret
session
setting
ssh
structs
sync
task
templates
test
timeutil
upload
user
util
validation
webhook