Code Monkey home page Code Monkey logo

Comments (7)

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From davidnaffis on April 19, 2008 08:30:43

Is there a temporary workaround until it's fixed in Rails?

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From honglilai on April 19, 2008 08:38:00

There's no workaround at the moment.

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From honglilai on April 20, 2008 02:50:16

Labels: -Priority-Medium Priority-High

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From [email protected] on April 21, 2008 19:38:21

I'm not sure I agree. The boot.rb file defines RAILS_ROOT at the very top, one of the first things Rails.boot
does is to call the preinitialize method. That method itself even uses RAILS_ROOT, even VendorBoot.run uses
it as a value in the require. So by the time Rails::Initializer.run is called RAILS_ROOT is very well defined and
should not error out.

This seems to only be a problem with Passenger. I really think this is something in the way framework_spawner.rb is working. In fact, if look at the code, you are only accounting for RAILS_ROOT in the
application spawner. I would imagine that the rails framework is going to rely more and more on RAILS_ROOT
being defined, so I think if Passenger is going to sidestep the boot.rb process which does that well ahead of
time, then you need to do so in both your application and your framework spawner. Does that sound
reasonable?

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From [email protected] on April 21, 2008 19:55:03

For instance, this hack works for me. http://github.com/metaskills/passenger/commit/69afcd75425a89c9d17d1fc40c0a7571d6bd547c Sorry, I'm not on the rspec bandwagon, or I would have written some tests.

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From honglilai on April 22, 2008 03:10:44

Hi metaskills.

The reason why FrameworkSpawner exists, is to reduce memory usage and startup time.
The idea is that the FrameworkSpawner loads all Rails framework code. Then, whenever
an application needs to be spawned, the FrameworkSpawner creates a child process,
which already contains the Rails framework. This removes the need to load the Rails
framework over and over, which reduces startup time. And because the child process
shares most memory with its parent process, memory usage is reduced.

However, any application, i.e. with any application root, may be spawned using a
FrameworkSpawner. Your change works in the case when Apache only serves a single
application, but will fail if it serves multiple applications (assuming that they
aren't all vendoring Rails, in which case your solution would work).

I think the reduced startup time and reduced memory usage is a pretty good reason to
make Rails rely less on RAILS_ROOT being available during boot. So I think it would
be better to patch Rails instead.

from passenger.

FooBarWidget avatar FooBarWidget commented on May 24, 2024

From honglilai on May 01, 2008 12:13:12

Fixed in the development version (git repository).

Status: Fixed
Labels: Milestone-1.1.0

from passenger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.