$LOADED_FEATURES.clear does not appear to clear internal set #413

Closed
headius opened this Issue Nov 26, 2012 · 4 comments

Comments

Projects
None yet
3 participants
@headius
Member

headius commented Nov 26, 2012

We have an internal set in the $LOADED_FEATURES array that allows include? and friends to be O(1) complexity. However, it seems like it's not being cleared properly for some of the Array methods like #clear:

system ~/projects/jruby $ jruby -Itmp -e 'puts require "nothing"; $LOADED_FEATURES.clear; puts require "nothing"'
in nothing
true
false

system ~/projects/jruby $ ruby-1.9.3 -Itmp -e 'puts require "nothing"; $LOADED_FEATURES.clear; puts require "nothing"'
in nothing
true
in nothing
true
@shepmaster

This comment has been minimized.

Show comment
Hide comment
@shepmaster

shepmaster Dec 29, 2012

Contributor

You addressed this in 10e6ea3, but reverted it in c325605 and then filed this issue. However, if I apply the first patch you had, your test case works:

$ touch /tmp/nothing.rb
$ ./bin/jruby -I/tmp -e 'puts require "nothing"; $LOADED_FEATURES.clear; puts require "nothing"'
true
true

What was the "Something's not right here" that caused you to revert?

Contributor

shepmaster commented Dec 29, 2012

You addressed this in 10e6ea3, but reverted it in c325605 and then filed this issue. However, if I apply the first patch you had, your test case works:

$ touch /tmp/nothing.rb
$ ./bin/jruby -I/tmp -e 'puts require "nothing"; $LOADED_FEATURES.clear; puts require "nothing"'
true
true

What was the "Something's not right here" that caused you to revert?

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Apr 5, 2016

Member

This is still valid in JRuby 9.1 and should be fixed.

Member

headius commented Apr 5, 2016

This is still valid in JRuby 9.1 and should be fixed.

@kares

This comment has been minimized.

Show comment
Hide comment
@kares

kares Apr 8, 2016

Member

this seems to be working (on master) now after: f147a5e + e00bf50 ... need a similar fix on jruby-1_7

Member

kares commented Apr 8, 2016

this seems to be working (on master) now after: f147a5e + e00bf50 ... need a similar fix on jruby-1_7

kares added a commit to kares/jruby that referenced this issue Jan 20, 2017

make sure $LOADED_FEATURES.clear behaves as expected
since this special array uses an internal set for speed

resolves #413

@kares kares self-assigned this Jan 20, 2017

@kares kares added this to the JRuby 9.1.8.0 milestone Jan 20, 2017

kares added a commit to kares/jruby that referenced this issue Jan 20, 2017

kares added a commit to kares/jruby that referenced this issue Jan 20, 2017

@kares kares closed this in 43cc895 Jan 20, 2017

@kares

This comment has been minimized.

Show comment
Hide comment
@kares

kares Jan 20, 2017

Member

wasn't fixed in the end - also needed some test tuning as some of the tests influenced others.
not sure about the backport for jruby-1_7 ... no one complained but its probably a good idea.

Member

kares commented Jan 20, 2017

wasn't fixed in the end - also needed some test tuning as some of the tests influenced others.
not sure about the backport for jruby-1_7 ... no one complained but its probably a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment