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

Bugfix: do not leak gRPC stream #4368

Merged
merged 1 commit into from May 19, 2023
Merged

Bugfix: do not leak gRPC stream #4368

merged 1 commit into from May 19, 2023

Conversation

wxing1292
Copy link
Contributor

What changed?

  • Do not recreate gRPC stream if error occurs, instead, rely on periodical health check to re-create stream

Why?
Do not recreate gRPC stream since this will lead to resource leak

How did you test it?
N/A

Potential risks
N/A

Is hotfix candidate?
N/A

@wxing1292 wxing1292 requested a review from a team as a code owner May 19, 2023 01:06
Comment on lines -153 to +149
streamCreationTime, stream := r.getStream()
if err := r.ackMessage(stream); err != nil {
r.recreateStream(streamCreationTime)
if err := r.ackMessage(r.stream); err != nil {
r.logger.Error("StreamReceiver exit send loop", tag.Error(err))
return
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the solution is to not recreate the gRPC stream, rely on the stream monitor to recreate the entire thing

@wxing1292 wxing1292 merged commit f723450 into master May 19, 2023
10 checks passed
@wxing1292 wxing1292 deleted the bugfix-stream-leak branch May 19, 2023 08:07
wxing1292 added a commit that referenced this pull request Jun 14, 2023
* Do not recreate gRPC stream if error occurs, instead, rely on periodical health check to re-create stream
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.

None yet

2 participants