I have a problem with assets on an asynchronous rails 3.1 application, I managed to build a minimal example showing my problem but it did not helped me much.
The application is really simple, what I did was:
– create a fresh application with 3.1 (non rc)
– add thin+Rack::FiberPool
– setup bourbon (scss mixins)
– run the application
Now I start a server with “rails server thin”, after that any request will end up in a “stack level too deep” with only one backtrace line :/
Here is the minimal application: https://github.com/schmurfy/assets_crash
Here is the backtrace I get when doing a request:
http://dl.dropbox.com/u/1313066/github/crash_assets.png
I tried to dig in to see where the problem was which led me in sass-rails in the file template_handlers.rb:
def sass_options(scope)
importer = self.importer(scope)
options = sass_options_from_rails(scope)
load_paths = (options[:load_paths] || []).dup
load_paths.unshift(importer)
# bnding.pry
options.merge(
:filename => eval_file,
:line => line,
:syntax => syntax,
:importer => importer,
:load_paths => load_paths,
:custom => {
:resolver => Resolver.new(scope)
}
)
end
I tried to explore with Pry (an irb alternative) and what I found is even more puzzling: While at the binding.pry line I can trigger a stack level too deep with:
{}.merge(:anything => Resolver.new(scope))
The result is immediate but I cannot find anything in that object which would explain the result.
Any lead would be welcome.
I finally found the answer: fibers only have 4Kb of stack space and Ruby on Rails is now too big to fit in this space :/