From 97dc6875e096e96617d8c8d03b6d0cd8a117f6d5 Mon Sep 17 00:00:00 2001 From: Ryo Nakao Date: Mon, 28 Mar 2022 23:28:23 +0900 Subject: [PATCH] Ensure to close StreamFrame channel (#12248) --- .changelog/12248.txt | 3 +++ api/fs.go | 1 + 2 files changed, 4 insertions(+) create mode 100644 .changelog/12248.txt diff --git a/.changelog/12248.txt b/.changelog/12248.txt new file mode 100644 index 000000000..5931f72d3 --- /dev/null +++ b/.changelog/12248.txt @@ -0,0 +1,3 @@ +```release-note:improvement +api: `AllocFS.Logs` now explicitly closes frames channel after being canceled +``` diff --git a/api/fs.go b/api/fs.go index e5340c966..e0a8383e9 100644 --- a/api/fs.go +++ b/api/fs.go @@ -257,6 +257,7 @@ func (a *AllocFS) Logs(alloc *Allocation, follow bool, task, logType, origin str // Check if we have been cancelled select { case <-cancel: + close(frames) return default: }