Disable loading of other rake tasks for resques [DEPLOY ON 12/19]
See original GitHub issueToday we ran into an issue with the importer after deploying a PR (#11031) which just included changes to another separate rake task. The issue was that the new rake added some objects to the global namespace (later fixed in #11044) and that caused the importer to fail to report some metrics.
Currently, when running rake tasks, we load all the tasks in the lib/tasks
directory (which is the Rails default), so if any rake tasks is behaving badly (like modifying core objects), it will affect the importer. A
solution is to have a second Rakefile
that is used only for resque:work
which avoids loading all the rest of rakes, in order to isolate it and minimize problems like the one we had today.
The proposed solution is just to create a new Rakefile.resque
, which is identical to our current one except for adding CartoDB::Application.paths['lib/tasks'] = []
so it does not loads all the tasks in lib/tasks
. The benefit is a more robust importer that is not affected by potential errors while coding other rakes, and also a marginally faster startup time.
We would have to create the new Rakefile and modify scripts/resque
to use it (passing a new parameter), as well as all resque service files.
Opinions? Do you think it’s worth it? cc @CartoDB/builder-backend @CartoDB/dataservices @CartoDB/systems
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
I talked with @ethervoid and another idea is to add the following to the Rakefile:
This automatically disables loading of other rake tasks if the task to be ran is
resque:work
, so no need to do further changes to scripts.I have never looked at what it contains; I was mostly thinking aloud in case it might help :_)