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: Wait until all go routines exit in Close() #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eshitachandwani
Copy link
Owner

@eshitachandwani eshitachandwani commented Aug 23, 2024

It was not guaranteed that when transport.Close() returned, the reader go-routines terminated. All the other channels like, ctxDone, writerDone, goAway are being waited upon for a signal

With fix :
7C1B754B-CFB0-4AA6-B526-97712531E448_1_201_a

Without fix :
4A420B3B-327A-40B8-90EE-FF99344294B8_1_201_a
cc3be4c17)

To ensure that transport.Close() only return after the reader go-routine terminates:

  • Wait for the readerDone channel to signal the completion

This fixes: grpc#2869

RELEASE NOTES:

grpc: Wait until reader go routine exits in transport.Close()

It was not guaranteed that when `transport.Close()` returned, the
reader go-routines terminated. All the other channels like,  `ctxDone`, `writerDone`, `goAway` are being waited upon for a signal

To ensure that `transport.Close()` only return after the reader go-routine terminates:

- Wait for the `readerDone` channel to signal the completion 

This fixes: grpc#2869

RELEASE NOTES:

grpc: Wait until reader go routine exits in transport.Close()
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

Successfully merging this pull request may close these issues.

ClientConn.Close does not wait for connections to be closed before returning
1 participant