Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[ruby] refactor flaky test and expose cancel_with_status #37410

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

Closed
wants to merge 13 commits into from

Conversation

apolcyn
Copy link
Contributor

@apolcyn apolcyn commented Aug 7, 2024

Fixes #37234

Following up on the problem described in #36903, there are a number of paths in client_server_spec.rb and a few other tests where client call objects can leak due to RPC lifecycles not being properly completed, leading to a thread not terminating. Some of the tests (which don't use the surface-level grpc-ruby APIs), are changed to manually terminate calls where necessary (if an RPC is not manually closed, then we rely on garbage collection to unref it, and if GC doesn't happen before ruby process shutdown initiates, then still-live calls can prevent a thread from terminating).

client_server_spec.rb is updated to use surface level APIs, which manages call lifecycles correctly (this also improves the test's fidelity).

While we're here: expose cancel_with_status on call operations. This was only accidentally private so far. The test refactoring caught it.

@apolcyn apolcyn added lang/ruby release notes: yes Indicates if PR needs to be in release notes labels Aug 7, 2024
@apolcyn apolcyn changed the title [ruby] fix test flake [ruby] refactor flaky test and expose cancel_with_status Aug 7, 2024
@apolcyn apolcyn requested a review from veblush August 7, 2024 16:39
@apolcyn apolcyn marked this pull request as ready for review August 7, 2024 16:40
@copybara-service copybara-service bot closed this in 0940f8e Aug 7, 2024
sourabhsinghs pushed a commit to sourabhsinghs/grpc that referenced this pull request Sep 26, 2024
Fixes grpc#37234

Following up on the problem described in grpc#36903, there are a number of paths in `client_server_spec.rb` and a few other tests where client call objects can leak due to RPC lifecycles not being properly completed, leading to a thread not terminating.

Some of the tests, which don't use the surface-level APIs, are changed to manually close calls (and not rely on GC which might not happen before shutdown of ruby threads). `client_server_spec.rb` is updated to use surface level APIs, which manages call lifecycles correctly (this also improves the test's fidelity).

While we're here: expose `cancel_with_status` on call operations. This was only accidentally private so far. The test refactoring caught it.

Closes grpc#37410

COPYBARA_INTEGRATE_REVIEW=grpc#37410 from apolcyn:fix_call_leak b230472
PiperOrigin-RevId: 660430463
paulosjca pushed a commit to paulosjca/grpc that referenced this pull request Nov 25, 2024
Fixes grpc#37234

Following up on the problem described in grpc#36903, there are a number of paths in `client_server_spec.rb` and a few other tests where client call objects can leak due to RPC lifecycles not being properly completed, leading to a thread not terminating.

Some of the tests, which don't use the surface-level APIs, are changed to manually close calls (and not rely on GC which might not happen before shutdown of ruby threads). `client_server_spec.rb` is updated to use surface level APIs, which manages call lifecycles correctly (this also improves the test's fidelity).

While we're here: expose `cancel_with_status` on call operations. This was only accidentally private so far. The test refactoring caught it.

Closes grpc#37410

COPYBARA_INTEGRATE_REVIEW=grpc#37410 from apolcyn:fix_call_leak b230472
PiperOrigin-RevId: 660430463
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/ruby release notes: yes Indicates if PR needs to be in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ruby run_ruby.sh test timeout
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.