Skip to content

Clear references to threads and thread contexts on teardown.#5390

Merged
enebo merged 1 commit intojruby:masterfrom
headius:clear_thread_objects
Oct 31, 2018
Merged

Clear references to threads and thread contexts on teardown.#5390
enebo merged 1 commit intojruby:masterfrom
headius:clear_thread_objects

Conversation

@headius
Copy link
Member

@headius headius commented Oct 30, 2018

This change clears the following on JRuby runtime teardown:

  • The thread-local context reference in ThreadService
    (dereferenced entirely)
  • The mainContext reference in ThreadService
  • The mapping from native threads to RubyThread instances.

This should clear all JRuby-specific runtime data attached to
both Ruby and adopted Java threads.

Fixes #3313.
Supersedes #3316.

This change clears the following on JRuby runtime teardown:

* The thread-local context reference in ThreadService
  (dereferenced entirely)
* The mainContext reference in ThreadService
* The mapping from native threads to RubyThread instances.

This should clear all JRuby-specific runtime data attached to
both Ruby and adopted Java threads.

Fixes jruby#3313.
Supersedes jruby#3316.
@headius headius force-pushed the clear_thread_objects branch from 58385cc to 9f72b0c Compare October 30, 2018 21:23
@headius
Copy link
Member Author

headius commented Oct 30, 2018

Re-pushed with a tweak to allow profiling to dump before clearing thread references.

Copy link
Member

@kares kares left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good.

@enebo enebo merged commit dc9cb9f into jruby:master Oct 31, 2018
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.

3 participants