Skip to content

Fixes for MRI tests#8485

Merged
headius merged 13 commits intojruby:10-devfrom
headius:mri_fixes
Dec 10, 2024
Merged

Fixes for MRI tests#8485
headius merged 13 commits intojruby:10-devfrom
headius:mri_fixes

Conversation

@headius
Copy link
Member

@headius headius commented Dec 5, 2024

Get them running and fix some stuff.

Fixes test/mri/test_io.rb:test_copy_stream_broken_src_read_eof
@headius headius added this to the JRuby 10.0.0.0 milestone Dec 5, 2024
* Calculate growth size in an initial loop.
* Add equivalent to str_ensure_available_capa for growing strings.
* Refactor for arity-split (just 0 and 1 arg forms added).
If a thread is killed and then quickly interrupted in another way,
it may end up polling for that other event and stop aborting from
the kill. This ensures that once aborted a thread can never stop
aborting by picking up a new interrupt event.

This broke the new test server in test/mri/net/http/utils.rb when
it killed the server and then closed the socket; while aborting
the closed socket could trigger additional exceptions, stopping
the abort. This ensures it will be seen at the next poll and
resumed.
In CRuby, a thread remains internally in "run" state while in the
process of being killed, but a killed bit is set for other
status-sensitive functions to check. This patch aligns behavior
with CRuby.
This is a temporary move until we can follow CRuby and implement
a native version of this function.

See jruby#8476
"aborting" is only presented as status when a thread has been
actively killed, which is implemented by a separate flag. The
thread remains internally in RUN status, as in CRuby.
Copied from my PR to fix this double-interrupt race.

See ruby/net-http#197
@headius headius marked this pull request as ready for review December 10, 2024 06:25
@headius headius merged commit eb975ad into jruby:10-dev Dec 10, 2024
46 of 73 checks passed
@headius headius deleted the mri_fixes branch December 10, 2024 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant