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

[Ruby] Fix memory leak in GRPC::Core::Call#run_batch #27900

Closed
wants to merge 1 commit into from

Conversation

peterzhu2118
Copy link
Contributor

The C function that backs this Ruby method can raise a variety of errors. In particular, grpc_run_batch_stack_fill_ops has a lot of places that raise errors. When an error is raised, allocated memory (e.g. run_batch_stack) is not freed and is permanently leaked.

This changes grpc_rb_call_run_batch to have an ensure block to perform cleanup and free all allocated resources.

@yashykt

@mauro-oto
Copy link

@jtattermusch @apolcyn is there any chance this will be reviewed or merged soon? Thank you!

The C function that backs this Ruby method can raise a variety of
errors. In particular, grpc_run_batch_stack_fill_ops has a lot of places
that raise errors. When an error is raised, allocated memory (e.g.
run_batch_stack) is not freed and is permanently leaked.

This changes grpc_rb_call_run_batch to have an ensure block to perform
cleanup and free all allocated resources.
@jtattermusch
Copy link
Contributor

@apolcyn needs to review this.

@stale
Copy link

stale bot commented Jun 12, 2022

This issue/PR has been automatically marked as stale because it has not had any update (including commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no further update occurs in 7 day. Thank you for your contributions!

@peterzhu2118
Copy link
Contributor Author

@apolcyn could I get a review on this?

@stale stale bot closed this Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants