Skip to content

Conversation

headius
Copy link
Member

@headius headius commented May 22, 2025

Because the proxy calculation tends to recurse for classes, there may be multiple StableValue preparing proxies at the same time. Depending on the ordering of the classes encountered, this can lead to deadlocks.

This fixes the deadlock by matching MapBasedClassValue's one lock per ClassValue instance, and also properly double-checks the value which was missing in the previous version.

Because the proxy calculation tends to recurse for classes, there
may be multiple StableValue preparing proxies at the same time.
Depending on the ordering of the classes encountered, this can
lead to deadlocks.

This fixes the deadlock by matching MapBasedClassValue's one lock
per ClassValue instance, and also properly double-checks the value
which was missing in the previous version.
@headius headius added this to the JRuby 9.4.13.0 milestone May 22, 2025
@headius headius merged commit 88dcc38 into jruby:jruby-9.4 May 23, 2025
97 checks passed
@headius headius deleted the fixed_stable_proxy_locking branch May 23, 2025 03:22
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