[ruby-core:112220] [Ruby master Bug#19415] Incorrect circularity warning for concurrent requires

Issue #19415 has been reported by fxn (Xavier Noria). ---------------------------------------- Bug #19415: Incorrect circularity warning for concurrent requires https://bugs.ruby-lang.org/issues/19415 * Author: fxn (Xavier Noria) * Status: Open * Priority: Normal * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- This script performs 5 concurrent `require` calls to the same file: ```ruby threads = [] 5.times do threads << Thread.new { p require 'bar' } end threads.each(&:join) ``` The file `bar.rb` is simply ```ruby 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. -- https://bugs.ruby-lang.org/

Issue #19415 has been updated by byroot (Jean Boussier). Backport changed from 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN to 2.7: WONTFIX, 3.0: WONTFIX, 3.1: REQUIRED, 3.2: REQUIRED I have a patch for this: https://github.com/ruby/ruby/pull/7252 That bug isn't very critical, but I think it wouldn't hurt to backport it, at least on recent versions. ---------------------------------------- Bug #19415: Incorrect circularity warning for concurrent requires https://bugs.ruby-lang.org/issues/19415#change-101654 * Author: fxn (Xavier Noria) * Status: Open * Priority: Normal * Backport: 2.7: WONTFIX, 3.0: WONTFIX, 3.1: REQUIRED, 3.2: REQUIRED ---------------------------------------- This script performs 5 concurrent `require` calls to the same file: ```ruby threads = [] 5.times do threads << Thread.new { p require 'bar' } end threads.each(&:join) ``` The file `bar.rb` is simply ```ruby 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. -- https://bugs.ruby-lang.org/

Issue #19415 has been updated by byroot (Jean Boussier). Status changed from Closed to Open Reopening as I reverted the patch because of some CI failures. I'll improve the patch and merge again tomorrow. ---------------------------------------- Bug #19415: Incorrect circularity warning for concurrent requires https://bugs.ruby-lang.org/issues/19415#change-101661 * Author: fxn (Xavier Noria) * Status: Open * Priority: Normal * Backport: 2.7: WONTFIX, 3.0: WONTFIX, 3.1: REQUIRED, 3.2: REQUIRED ---------------------------------------- This script performs 5 concurrent `require` calls to the same file: ```ruby threads = [] 5.times do threads << Thread.new { p require 'bar' } end threads.each(&:join) ``` The file `bar.rb` is simply ```ruby 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. -- https://bugs.ruby-lang.org/

Issue #19415 has been updated by byroot (Jean Boussier). Status changed from Open to Closed Fixed by `4713b084da2e03451e3478ad63b148545db3f1a9` and `1e711439762f47be1d1770b058a2f0246f64eab9` ---------------------------------------- Bug #19415: Incorrect circularity warning for concurrent requires https://bugs.ruby-lang.org/issues/19415#change-101710 * Author: fxn (Xavier Noria) * Status: Closed * Priority: Normal * Backport: 2.7: WONTFIX, 3.0: WONTFIX, 3.1: REQUIRED, 3.2: REQUIRED ---------------------------------------- This script performs 5 concurrent `require` calls to the same file: ```ruby threads = [] 5.times do threads << Thread.new { p require 'bar' } end threads.each(&:join) ``` The file `bar.rb` is simply ```ruby 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. -- https://bugs.ruby-lang.org/

Issue #19415 has been updated by byroot (Jean Boussier). Fixed by 8ce2fb9bbbaea14737c84385b1573f743a30f773 ---------------------------------------- Bug #19415: Incorrect circularity warning for concurrent requires https://bugs.ruby-lang.org/issues/19415#change-101714 * Author: fxn (Xavier Noria) * Status: Open * Priority: Normal * Backport: 2.7: WONTFIX, 3.0: WONTFIX, 3.1: REQUIRED, 3.2: REQUIRED ---------------------------------------- This script performs 5 concurrent `require` calls to the same file: ```ruby threads = [] 5.times do threads << Thread.new { p require 'bar' } end threads.each(&:join) ``` The file `bar.rb` is simply ```ruby 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. -- https://bugs.ruby-lang.org/

Issue #19415 has been updated by naruse (Yui NARUSE). Backport changed from 2.7: WONTFIX, 3.0: WONTFIX, 3.1: REQUIRED, 3.2: REQUIRED to 2.7: WONTFIX, 3.0: WONTFIX, 3.1: REQUIRED, 3.2: DONE ruby_3_2 53f6173cfc085a7422b4a76c85e6c35969209327 merged revision(s) 8ce2fb9bbbaea14737c84385b1573f743a30f773,3a0f6ce1d31eefd8af01b50f3632a64d64e8f8c1. ---------------------------------------- Bug #19415: Incorrect circularity warning for concurrent requires https://bugs.ruby-lang.org/issues/19415#change-102141 * Author: fxn (Xavier Noria) * Status: Closed * Priority: Normal * Backport: 2.7: WONTFIX, 3.0: WONTFIX, 3.1: REQUIRED, 3.2: DONE ---------------------------------------- This script performs 5 concurrent `require` calls to the same file: ```ruby threads = [] 5.times do threads << Thread.new { p require 'bar' } end threads.each(&:join) ``` The file `bar.rb` is simply ```ruby 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. -- https://bugs.ruby-lang.org/

Issue #19415 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 2.7: WONTFIX, 3.0: WONTFIX, 3.1: REQUIRED, 3.2: DONE to 2.7: WONTFIX, 3.0: WONTFIX, 3.1: DONE, 3.2: DONE ruby_3_1 26b3f0b6a9489860e1d312369d784495b080daa3 merged revision(s) 8ce2fb9bbbaea14737c84385b1573f743a30f773,3a0f6ce1d31eefd8af01b50f3632a64d64e8f8c1. ---------------------------------------- Bug #19415: Incorrect circularity warning for concurrent requires https://bugs.ruby-lang.org/issues/19415#change-102491 * Author: fxn (Xavier Noria) * Status: Closed * Priority: Normal * Backport: 2.7: WONTFIX, 3.0: WONTFIX, 3.1: DONE, 3.2: DONE ---------------------------------------- This script performs 5 concurrent `require` calls to the same file: ```ruby threads = [] 5.times do threads << Thread.new { p require 'bar' } end threads.each(&:join) ``` The file `bar.rb` is simply ```ruby 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. -- https://bugs.ruby-lang.org/
participants (4)
-
byroot (Jean Boussier)
-
fxn (Xavier Noria)
-
nagachika (Tomoyuki Chikanaga)
-
naruse (Yui NARUSE)