Bug #20019
closedRuby 3.3 GVL instrumentation events are fired out of order
Description
The order of instrumentation events is incorrect, and inconsistent with Ruby 3.2 ordering. You can find a spec to reproduce the broken behavior here: https://github.com/ruby/ruby/pull/9019.
Steps to reproduce¶
- Pull down this PR: https://github.com/ruby/ruby/pull/9019
- Run
make test-all TESTS="../test/-ext-/thread/test_instrumentation_api.rb --name=TestThreadInstrumentation#test_order_of_events"
- Run
RUBY_MN_THREADS=1 make test-all TESTS="../test/-ext-/thread/test_instrumentation_api.rb --name=TestThreadInstrumentation#test_order_of_events"
Expected behavior¶
It should pass the spec, and the events for each thread should match the array %w[started ready resumed suspended exited]
. That is the consistent behavior on Ruby 3.2.
Actual behavior¶
When running make test-all TESTS="../test/-ext-/thread/test_instrumentation_api.rb --name=TestThreadInstrumentation#test_order_of_events"
, the array of events is %w[ready resumed started exited suspended]
.
When running with RUBY_MN_THREADS=1
, the array of events is %w[ready started exited suspended]
.
Updated by byroot (Jean Boussier) 12 months ago
- Status changed from Open to Closed
Applied in changeset git|982641939cf709d22dbc060df57cbed31acd3b97.
Further fix the GVL instrumentation API
Followup: https://github.com/ruby/ruby/pull/9029
[Bug #20019]
Some events still weren't triggered from the right place.
The test suite was also improved a bit more.