Skip to content

Commit 2350fdc

Browse files
committed
should call this cancel to avoid goroutine leakage
1 parent 2d8df47 commit 2350fdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rpc/rpc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,7 @@ func (v *Vibranium) RunAndWait(stream pb.CoreRPC_RunAndWaitServer) error {
826826
// force mark stdin to false
827827
opts.OpenStdin = false
828828
}
829+
defer cancel()
829830

830831
v.taskAdd("RunAndWait", true)
831832

@@ -858,7 +859,6 @@ func (v *Vibranium) RunAndWait(stream pb.CoreRPC_RunAndWaitServer) error {
858859

859860
runAndWait := func(f func(<-chan *types.AttachWorkloadMessage)) {
860861
defer v.taskDone("RunAndWait", true)
861-
defer cancel()
862862
f(ch)
863863
}
864864

0 commit comments

Comments
 (0)