Commit Graph

73 Commits

Author SHA1 Message Date
Alan Wu b85ebb9bba [ruby] Fix use-after-free for post-fork channel recreation (#35488)
The `grpc_channel_args` is retained on the Ruby object and used for recreating the channel after forking in
grpc_rb_channel_maybe_recreate_channel_after_fork(). Previously, the key for each argument was taken from a Ruby string directly, which could be invalidated if the Ruby string is modified or moved by the GC. Duplicate the string for the key instead, so we own it.

Reproducer in https://github.com/grpc/grpc/issues/35489

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #35488

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35488 from Shopify:key-uaf c1813cee01
PiperOrigin-RevId: 599304551
2024-01-17 15:19:45 -08:00
apolcyn 7c21997dba
[ruby] remove unnecessary background thread startup wait logic that interferes with forking (#33805)
Alternative to https://github.com/grpc/grpc/pull/33804 - this takes the
approach in
https://github.com/grpc/grpc/pull/33804#issuecomment-1645792677

Fix https://github.com/grpc/grpc/issues/33802

cc @casperisfine
2023-07-24 15:17:54 -07:00
apolcyn d4cbb7a96d
[ruby] fix crash when prefork/postfork is used without previously using grpc (#33788)
Should fix https://github.com/grpc/grpc/issues/33787
2023-07-20 11:26:02 -07:00
apolcyn a28900a9cf
[ruby] raise RPC deadline in a flakey test (#33713)
As title - use a deadline that rules out starvation as a source of
flakiness
2023-07-20 10:07:24 -07:00
apolcyn fe11ec9bcb
[ruby] experimental client side fork support (#33430)
Adds experimental fork support to gRPC/Ruby

Works towards https://github.com/grpc/grpc/issues/8798 (see caveats for why this wasn't marked fixed yet)
Works towards https://github.com/grpc/grpc/issues/33578 (see caveats for why this wasn't marked fixed yet)

This leverages existing `pthread_atfork` based C-core support for
forking that python/php use, but there's a bit extra involved mainly
because gRPC/Ruby has additional background threads.

New tests under `src/ruby/end2end` show example usage.

Based on https://github.com/grpc/grpc/pull/33495

Caveats:
- Bidi streams are not yet supported (bidi streams spawn background
threads which are not yet fork safe)
- Servers not supported
- Only linux supported
2023-07-10 13:34:10 -07:00
apolcyn 4777db3003
[ruby testing]: experimental change to grpc_class_init_test (#32337)
Let's see if this fixes the "Bus error" flakes that have been happening
in CI.

If it does, then we can narrow things down a bit. If flakes continue,
then we can revert this PR.
2023-02-14 14:49:11 -08:00
apolcyn 8734964482
Simplify ruby class init test (#32307) 2023-02-07 10:39:03 -08:00
apolcyn e31cfaaa11
Update default ruby version to 3.2 on linux/macos ruby builds (#32010)
* Use ruby 3.2 in macos and linux ruby builds
2023-01-03 13:38:15 -08:00
apolcyn dc3e7a3f0d
Bump timeouts in ruby end2end tests (#31266) 2022-10-06 13:54:54 -07:00
Hannah Shi 0fc521067b
Ruby: support for PSM security (#25330)
* support for PSM security, SSL fallback

* Ruby Server, support for PSM security, SSL fallback

* address review comments

* add more tests, address review comments

* add XdsChannelCredentials class for PSM security, ruby client

* XdsServerCredentials

* address review comments

* re-run tools/distrib/clang_format_code.sh

* address comments, add entries to grpc_class_init_test

* fix to pass end2end ci test

* re-run tools/distrib/clang_format_code.sh

* address comments
2021-03-04 13:32:30 -08:00
Stanley Cheung 45e41137a8
Replaces disrespectful terms (#25501) 2021-02-19 01:27:17 -08:00
apolcyn 6102f67ade
Merge pull request #25442 from apolcyn/fix_ruby_e2e_test_port_picking
Fix child process port allocation in ruby end-to-end tests
2021-02-12 17:00:52 -08:00
Alexander Polcyn 27687563d6 Fix child process port selection in ruby end-to-end tests 2021-02-12 13:45:42 -08:00
apolcyn 5c214d57e4
Merge pull request #25406 from apolcyn/fix_ruby_flake
Fix flake in ruby call creds timeout test
2021-02-12 09:13:11 -08:00
Alexander Polcyn b14019661f Don't perform unnecessary RPCs in call creds timeout test 2021-02-11 20:02:08 -08:00
Alexander Polcyn 01c52d7c77 Fix no free threads flake in ruby call creds timeout test 2021-02-11 15:56:53 -08:00
Yash Tibrewal 7c8defd5c9
Merge pull request #25377 from yashykt/removedisrespecfulterm2
Replace disrespectful term
2021-02-10 15:20:27 -08:00
Yash Tibrewal f4e55b85bc Replace disrespectful term 2021-02-08 15:29:53 -08:00
Yash Tibrewal 7a5288d2a0 Replace disrespectful words 2021-02-08 14:29:18 -08:00
Jan Tattermusch a35cd4f89d build protoc artifacts with cmake 2020-12-09 11:54:44 +01:00
Hannah Shi 0765a1c70a change test case to absolute package name 2020-08-12 05:36:00 +00:00
Alexander Polcyn 9b4ef62cb9 Split up run_ruby_end2end_tests.sh into more granular test targets 2020-07-27 15:07:23 -07:00
apolcyn 3d4d992470
Merge pull request #23619 from apolcyn/fix_ruby_call_cred_timeout_test
Remove an invalid assumption from ruby call creds timeout test
2020-07-27 15:04:35 -07:00
Alexander Polcyn cba97021a9 Remove an invalid assumption from ruby call creds timeout test 2020-07-27 10:42:13 -07:00
Alexander Polcyn 59da17dd7d Fix parent/child process synchronization in two ruby tests 2020-07-26 23:10:18 -07:00
Alexander Polcyn d88b77aaab Add logs to a flakey ruby test that can help to diagnose issue 2020-07-21 12:11:35 -07:00
Alexander Polcyn 9e8f671cee Update license date; fix format and typo 2020-06-26 23:00:31 -07:00
Alexander Polcyn 95387716dc Make sure call creds user callbacks can't kill the ruby call credentials thread 2020-06-26 18:29:22 -07:00
Alexander Polcyn b88c0a22c7 Fix use-after-free in ruby call creds 2020-06-26 13:26:54 -07:00
tanjunchen 64cdea5a07 fix some spelling mistakes in document 2019-10-04 09:07:35 +08:00
Mike Moore 0f8dced6c4
Define Struct::Status in Ruby
Update error end2end test for loading when calling to_status.
Update error end2end test for loading when calling to_rpc_status.
2019-08-15 17:34:51 -06:00
Mike Moore b132c34c61
Allow loading grpc/errors before grpc 2019-08-13 10:36:07 -06:00
Tommy Chen 39ac83a49e ruby-sigint ready to be merged! 2018-12-26 11:17:48 -08:00
ncteisen 68d4f50f77 Merge branch 'master' of https://github.com/grpc/grpc into channelz 2018-06-19 14:00:52 -07:00
ganmacs 0b4fb6a5e2 Move a script which has a pre-requirement to outside of spec
And make it to be execute when using `./tools/run_tests/run_tests.py -l ruby`
2018-06-16 22:38:15 +09:00
ncteisen 19ac7c0baf Fix ruby test by backing off on the concurrency 2018-06-13 15:06:07 -07:00
ncteisen cb5471c2ee Sleep less for ruby test 2018-06-11 20:07:43 -07:00
Alexander Polcyn d3594987df fix race whereby we can call watch_connectivity_state on a destroyed channel 2018-04-05 03:49:53 -07:00
everysick bae00e08cc Add test for verifying to get memory usage in client request 2018-03-29 09:13:55 +09:00
Alexander Polcyn b14f1ea602 Disable soreuseport in ruby unit tests 2017-12-13 16:43:00 -08:00
Alexander Polcyn f7a869fdbe Unref global backup poller under its lock 2017-12-07 09:59:15 -08:00
apolcyn 1972e5ce74
Merge pull request #12710 from apolcyn/speedup_ruby_end2end_tests
Fix a race in ruby server shutdown and cleanup for ruby tests
2017-11-27 23:27:50 -08:00
Alex Polcyn 81e9581bf3 Remove some sleeps in ruby tests and fix test server shutdown 2017-11-27 20:29:19 -08:00
Alexander Polcyn 8c12d9eae6 Add a test under ruby GC stress mode and fix non-GC-rooted variable bug 2017-10-05 09:31:48 -07:00
Alexander Polcyn 2f3e588099 Dont assume that sigint wasnt masked when invoking ruby tests 2017-09-21 13:48:53 -07:00
Alexander Polcyn 010ea65be5 remove calls to optional paramaters so that the test is compatible with ruby versions < 2.1 2017-09-05 09:40:17 +02:00
Jan Tattermusch 4d5c3102a1 fix remaining license notices 2017-06-08 11:22:41 +02:00
Jan Tattermusch 7897ae9308 auto-fix most of licenses 2017-06-08 11:22:41 +02:00
Alexander Polcyn d7455abfbd make get conn state always safe to call 2017-05-17 21:49:14 -07:00
Alexander Polcyn c24d53b0cf api watch unblock func kills only its own channel 2017-05-17 21:20:34 -07:00