[ruby] refactor flaky test and expose cancel_with_status#37410
Closed
apolcyn wants to merge 13 commits intogrpc:masterfrom
Closed
[ruby] refactor flaky test and expose cancel_with_status#37410apolcyn wants to merge 13 commits intogrpc:masterfrom
apolcyn wants to merge 13 commits intogrpc:masterfrom
Conversation
veblush
approved these changes
Aug 7, 2024
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #37234
Following up on the problem described in #36903, there are a number of paths in
client_server_spec.rband 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.rbis 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_statuson call operations. This was only accidentally private so far. The test refactoring caught it.