question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Disable loading of other rake tasks for resques [DEPLOY ON 12/19]

See original GitHub issue

Today 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:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
javitoninocommented, Dec 15, 2016

I talked with @ethervoid and another idea is to add the following to the Rakefile:

if Rake.application.top_level_tasks.include?('resque:work')
  CartoDB::Application.paths['lib/tasks'] = []
end

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.

0reactions
juanignacioslcommented, Dec 15, 2016

I have never looked at what it contains; I was mostly thinking aloud in case it might help :_)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disabling specific groups of rake tasks - ruby on rails
I'm working with a large Rails application, and i've been tasked with disabling rake tasks that could be harmful if run on our...
Read more >
Rake tasks - GitLab Docs
GitLab provides Rake tasks to assist you with common administration and operational ... Uploads sanitize, Remove EXIF data from images uploaded to earlier ......
Read more >
and Stop tasks for resque workers, with capistrano deploy ...
Start and Stop tasks for resque workers, with capistrano deploy hook (without God) - deploy.rb.
Read more >
Disable unsafe rake tasks in Rails production environment
Let's look at how we can do that. First, let's define a rake task that simply raises an exception if you run it...
Read more >
desr 6055.09_afman91-201_afgm2022-01 - Air Force
(Added)(AF) For other modifications or changes in use that do not affect QD or explosives safety criteria, submit a memorandum describing the facility ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found