Skip to content

test_status_and_stop_p exposes a race in Thread status #5312

@headius

Description

@headius

The test test_status_and_stop_p in at test/mri/ruby/test_thread.rb:460 attempts a complicated set of thread status checks. One of these checks, specifically the assert_equal(nil, a.status) seem to expose a race in the death of a thread on JRuby.

The logic reached at this point asserts that #status shall be nil for a thread that returns false for #alive?. However in JRuby, before the Thread has completed dying and the status is cleared, the status is "dead". Occasionally this test executes quickly enough to see that the thread has started dying but not yet completed.

The "dead" status needs to be audited and compared with MRI behaviors, since it may be acceptable to clear the status immediately once the thread is assuredly on its way to dying.

I will mask out the test for now.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions