This project is archived and is in readonly mode.
Racing Inside ActiveSupport::Dependencies
-
skibumsworld
Same test, modified to run with activesupport 2.0.2
-
Jeremy Kemper
- State changed from new to open
- Milestone set to 2.1.1
- Assigned user set to Jeremy Kemper
-
DrMark
Jeremy,
While you are working in there, would you fix the typo in will_unload?. It is currently:
def will_unload?(const_desc)
autoloaded?(desc) ||
explicitly_unloadable_constants.include?(to_constant_name(const_desc))
end
but should be:
def will_unload?(const_desc)
autoloaded?(const_desc) ||
explicitly_unloadable_constants.include?(to_constant_name(const_desc))
end
Note the autoloaded line. I will make a separate ticket if necessary.
Thanks!
DrMark
-
skibumsworld
Here's a patch that fixes the problem.
-
Jeremy Kemper
- Tag changed from activesupport, dependencies to activesupport, dependencies, patch
skibumsworld, could you use a Mutex instead? Thread.critical has issues on jruby so other synchronization primitives are preferred.
-
Jeremy Kemper
DrMark, will_unload? appears to be completely unused. Do you use it?
-
DrMark
Hi Jeremy,
Yes. The benchmarkforrails plugin uses it (among others). I thought that it was odd that a bug that obvious could get through :)
If you could fix it or remove it that would be great. That would save me having to monkey patch it all the time :)
Thanks!
-
Jeremy Kemper
Quite so, DrMark. I fixed it in master, 2-1-stable, and 2-0-stable. How odd.
-
Jeremy Kemper
- Assigned user changed from Jeremy Kemper to josh
- State changed from open to stale
- Milestone cleared.
-
Jeremy Kemper
- Milestone set to 2.1.3
- State changed from stale to open
- Assigned user changed from josh to Jeremy Kemper
-
Stephen Bannasch
Here are links to two related bugs in ruby's implementation of require when used with threads:
require is not thread-safe http://redmine.ruby-lang.org/iss...
autoload is not thread-safe http://redmine.ruby-lang.org/iss...
Basically there does not appear to be a safe way for require to work in a multi-threaded application unless the first use of require locks until the require is complete.
-
Pratik
- State changed from open to stale
Putting the ticket in stale. Please reopen if this is still an issue.
Thanks.
