Skip to content

Commit 5c6ea7f

Browse files
authored
Merge pull request #5293 from wzshiming/fix/eveny-error-message
Fix return event publishing error
2 parents c381ea2 + 45df696 commit 5c6ea7f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

cmd/containerd-shim/main_unix.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,10 @@ func (l *remoteEventsPublisher) Publish(ctx context.Context, topic string, event
297297
cmd := exec.CommandContext(ctx, containerdBinaryFlag, "--address", l.address, "publish", "--topic", topic, "--namespace", ns)
298298
cmd.Stdin = bytes.NewReader(data)
299299
b := bufPool.Get().(*bytes.Buffer)
300-
defer bufPool.Put(b)
300+
defer func() {
301+
b.Reset()
302+
bufPool.Put(b)
303+
}()
301304
cmd.Stdout = b
302305
cmd.Stderr = b
303306
c, err := reaper.Default.Start(cmd)

0 commit comments

Comments
 (0)