diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2020-07-09 13:32:20 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2020-07-09 15:13:07 +0200 |
commit | 09dc77aedfb786505bc526536be18d457fb7c68b (patch) | |
tree | d45bf64bf131493553f3444880a1386d9b238f04 /pkg/varlinkapi | |
parent | edf5fe8b17f39ce98805c279b9795bfd4123abe2 (diff) | |
download | podman-09dc77aedfb786505bc526536be18d457fb7c68b.tar.gz podman-09dc77aedfb786505bc526536be18d457fb7c68b.tar.bz2 podman-09dc77aedfb786505bc526536be18d457fb7c68b.zip |
log API: add context to allow for cancelling
Add a `context.Context` to the log APIs to allow for cancelling
streaming (e.g., via `podman logs -f`). This fixes issues for
the remote API where some go routines of the server will continue
writing and produce nothing but heat and waste CPU cycles.
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/varlinkapi')
-rw-r--r-- | pkg/varlinkapi/containers.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/varlinkapi/containers.go b/pkg/varlinkapi/containers.go index 8650ba000..07b492331 100644 --- a/pkg/varlinkapi/containers.go +++ b/pkg/varlinkapi/containers.go @@ -754,7 +754,7 @@ func (i *VarlinkAPI) GetContainersLogs(call iopodman.VarlinkCall, names []string if err != nil { return call.ReplyErrorOccurred(err.Error()) } - if err := i.Runtime.Log(containers, &options, logChannel); err != nil { + if err := i.Runtime.Log(getContext(), containers, &options, logChannel); err != nil { return err } go func() { |