Actions
Bug #19415
closedIncorrect circularity warning for concurrent requires
Description
This script performs 5 concurrent require
calls to the same file:
threads = []
5.times do
threads << Thread.new {
p require 'bar'
}
end
threads.each(&:join)
The file bar.rb
is simply
sleep 0.1
Now, if you execute the main script with warnings enabled:
ruby -W2 -I. foo.rb
you'll see one true
and four false
as expected. But also four warnings:
circular require considered harmful - /Users/fxn/tmp/bar.rb
As you see, there isn't really a circular require
going on, so the warning itself is incorrect. On the other hand, concurrent require
calls for the same file is something routinely happening and supported.
I'd suggest that script should issue no warning.
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0