mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
docker: close hijacked write connection when exec ends (#24244)
This commit is contained in:
3
.changelog/24244.txt
Normal file
3
.changelog/24244.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
docker: Fixed a bug where alloc exec could leak a goroutine
|
||||
```
|
||||
@@ -1836,7 +1836,11 @@ func (d *Driver) ExecTaskStreaming(ctx context.Context, taskID string, opts *dri
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to attach to exec: %v", err)
|
||||
}
|
||||
defer resp.Close()
|
||||
defer func() {
|
||||
opts.Stdin.Close() // close stdin
|
||||
resp.CloseWrite() // close hijacked write connection
|
||||
resp.Close() // close read connection
|
||||
}()
|
||||
|
||||
go func() {
|
||||
if !opts.Tty {
|
||||
|
||||
Reference in New Issue
Block a user