Skip to content

Commit 598dcf6

Browse files
tonicmuroqCMGS
authored andcommitted
should be cancelled here (#390)
1 parent 1f93621 commit 598dcf6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rpc/rpc.go

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

831830
v.taskAdd("RunAndWait", true)
832831

@@ -848,6 +847,7 @@ func (v *Vibranium) RunAndWait(stream pb.CoreRPC_RunAndWaitServer) error {
848847

849848
ids, ch, err := v.cluster.RunAndWait(ctx, deployOpts, inCh)
850849
if err != nil {
850+
cancel()
851851
return grpcstatus.Error(RunAndWait, err.Error())
852852
}
853853

@@ -865,6 +865,7 @@ func (v *Vibranium) RunAndWait(stream pb.CoreRPC_RunAndWaitServer) error {
865865
// then deal with the rest messages
866866
runAndWait := func(f func(<-chan *types.AttachWorkloadMessage)) {
867867
defer v.taskDone("RunAndWait", true)
868+
defer cancel()
868869
f(ch)
869870
}
870871

0 commit comments

Comments
 (0)