Skip to content

Commit

Permalink
drpcmanager: cancel stream with error when terminated
Browse files Browse the repository at this point in the history
Terminations were canceling streams with `context.Canceled` instead
of surfacing the error, causing unexpected behavior.
  • Loading branch information
kylecarbs committed Apr 24, 2022
1 parent 41e8fa5 commit c366353
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drpcmanager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ func (m *Manager) manageStream(ctx context.Context, stream *drpcstream.Stream) {

select {
case <-m.sigs.term.Signal():
stream.Cancel(context.Canceled)
err, _ := m.sigs.term.Get()
stream.Cancel(err)
<-m.sterm
return

Expand Down

0 comments on commit c366353

Please sign in to comment.