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

Fix call destruction bug #10468

Merged
merged 2 commits into from
Apr 7, 2017

Conversation

murgatroid99
Copy link
Member

The Node glue code has a mechanism to destroy a call after the last batch has completed. In some cases, the call could get garbage collected before its final batch completed, which would cause errors. This change fixes that by adding a Persistent to the tag that keeps the JavaScript-level call object alive as long as it has a pending batch.

@@ -521,6 +523,7 @@ Call::Call(grpc_call *call) : wrapped_call(call),
Call::~Call() {
if (wrapped_call != NULL) {
Copy link
Member

Choose a reason for hiding this comment

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

Since that code is duplicated into line 571, I'm usually more in favor of adding a "destroy" method that's containing the code in a unique manner, but called from the two locations. That way you can keep the if (wrapped_call != NULL) logic segregated into that specialized function.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Member

@nicolasnoble nicolasnoble left a comment

Choose a reason for hiding this comment

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

LGTM.

@murgatroid99
Copy link
Member Author

The interop failure is #10455 and I can't tell what happened to the performance tests, but the Node performance tests passed.

@murgatroid99 murgatroid99 merged commit bbf4e5b into grpc:v1.2.x Apr 7, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants