0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-26 01:05:14 +01:00
gitea/modules
zeripath 0dcc74a8a7
Prevent dangling cat-file calls (goroutine alternative) (#19454)
If an `os/exec.Command` is passed non `*os.File` as an input/output, go
will create `os.Pipe`s and wait for their closure in `cmd.Wait()`.  If
the code following this is responsible for closing `io.Pipe`s or other
handlers then on process death from context cancellation the `Wait` can
hang.

There are two possible solutions:

1. use `os.Pipe` as the input/output as `cmd.Wait` does not wait for these.
2. create a goroutine waiting on the context cancellation that will close the inputs.

This PR provides the second option - which is a simpler change that can
be more easily backported.

Closes #19448

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-04-22 17:20:04 +02:00
..
activitypub
analyze
appstate
auth
avatar
base
cache
charset
container
context RepoAssignment ensure to close before overwrite (#19449) 2022-04-21 17:17:57 +02:00
convert Set correct PR status on 3way on conflict checking (#19457) 2022-04-21 22:55:45 +01:00
csv
doctor
emoji
eventsource
generate
git Prevent dangling cat-file calls (goroutine alternative) (#19454) 2022-04-22 17:20:04 +02:00
gitgraph
graceful
hcaptcha
highlight
hostmatcher
httpcache
httplib
indexer
json
lfs
log
markup
metrics
migration
nosql
notification
options
packages
paginator
password
pprof
private
process
proxy
public
queue
recaptcha
references
repository
secret
session
setting
ssh
storage
structs
svg
sync
templates
test
timeutil
translation
typesniffer
updatechecker
upload
uri
user
util
validation
web