File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -534,6 +534,10 @@ func (cs *clientStream) commitAttempt() {
534534// the error that should be returned by the operation. If the RPC should be
535535// retried, the bool indicates whether it is being retried transparently.
536536func (cs * clientStream ) shouldRetry (err error ) (bool , error ) {
537+ if cs .finished || cs .committed {
538+ // RPC is finished or committed; cannot retry.
539+ return false , err
540+ }
537541 if cs .attempt .s == nil {
538542 // Error from NewClientStream.
539543 nse , ok := err .(* transport.NewStreamError )
@@ -559,10 +563,6 @@ func (cs *clientStream) shouldRetry(err error) (bool, error) {
559563 return true , nil
560564 }
561565 }
562- if cs .finished || cs .committed {
563- // RPC is finished or committed; cannot retry.
564- return false , err
565- }
566566 // Wait for the trailers.
567567 unprocessed := false
568568 if cs .attempt .s != nil {
You can’t perform that action at this time.
0 commit comments