Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[grpc_retry] Broken retry logic on client streaming #497

Open
imcom opened this issue Jul 3, 2022 · 1 comment
Open

[grpc_retry] Broken retry logic on client streaming #497

imcom opened this issue Jul 3, 2022 · 1 comment

Comments

@imcom
Copy link

imcom commented Jul 3, 2022

IIUC, this grpc_retry for client streaming is just broken ... here is the core retry logic ... where we have

func (s *serverStreamingRetryingStream) receiveMsgAndIndicateRetry(m interface{}) (bool, error) {
	s.mu.RLock()
	wasGood := s.receivedGood
	s.mu.RUnlock()
	err := s.getStream().RecvMsg(m)
	if err == nil || err == io.EOF {
		s.mu.Lock()
		s.receivedGood = true
		s.mu.Unlock()
		return false, err
	} else if wasGood {
		// previous RecvMsg in the stream succeeded, no retry logic should interfere
		return false, err
	}

Note that the wasGood once it is true ... it will be always true ... hence skipping all retry logic even if there is an error. The retry can take place only if the very first call failed with retry-able errors ...

A screenshot from my debug session can demonstrate it more clearly

image

@bwplotka
Copy link
Collaborator

Do you mind trying v2 retry and potentially writing unit test to reproduce? That would be super helpful.

The data you provides is too little. We don't know where this method is used and how - more info would be needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants