Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do lazy instruction deserialization against dup'ed reader #6275

Merged
merged 1 commit into from Jun 15, 2020

Conversation

headius
Copy link
Member

@headius headius commented Jun 9, 2020

Instruction reading is done lazily to avoid the cost of
deserializing method bodies that will never be called. However the
buffer associated with the original file was being shared across
all of these lazy deserializations, causing concurrency issues.

This patch modifies the lazy deserialization lambda to operate
against a duplicate of the original reader, isolating its changes
in a separate buffer and avoiding the concurrency issues.

Fixes #6210

Instruction reading is done lazily to avoid the cost of
deserializing method bodies that will never be called. However the
buffer associated with the original file was being shared across
all of these lazy deserializations, causing concurrency issues.

This patch modifies the lazy deserialization lambda to operate
against a duplicate of the original reader, isolating its changes
in a separate buffer and avoiding the concurrency issues.

Fixes jruby#6210
@headius headius added this to the JRuby 9.3.0.0 milestone Jun 9, 2020
@headius headius requested a review from enebo Jun 9, 2020
@enebo enebo merged commit 0953009 into jruby:master Jun 15, 2020
1 check passed
@enebo enebo modified the milestones: JRuby 9.3.0.0, JRuby 9.2.12.0 Jun 15, 2020
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.

Multithreaded code with function calls fail in precompiled JRuby classes
2 participants