Home Delayed job stopped working after changing server from passenger to puma
Reply: 0

Delayed job stopped working after changing server from passenger to puma

user46477
1#
user46477 Published in September 20, 2018, 12:44 pm

Recently I just changed server for my production environment from passenger to puma. Before puma delayed job was working fine without any error but after puma it stopped working.

I am running 3 Delayed job to handle incoming requests on two different servers by dividing them as server 1 : 1 Job and server 2 : 2 Jobs.

RAILS_ENV=production bin/delayed_job -i first --queues=job_1,job_2 start

This command I am using to start delayed job after deployment. I am using Capistrano 3 for deployment. Also I have upgrade version of Capistrano version 2 to 3.

In Capistrano 2 we had

require 'delayed/recepies'

but as per delayed job official documentation I have created a rake task and executing in order to start job again.

It creates a new entry in delayed_jobs table as Delayed::Backend::ActiveRecord::Job.

What's wrong I am doing here? Is there any worker not listening to my incoming calls? Should I need to start additional things?

----UPDATED----

This is the rake task I have created to restart the jobs.

task :restart do
  on roles(delayed_job_roles) do
    within release_path do
      with rails_env: fetch(:rails_env) do
        execute('cd #{current_path};RAILS_ENV=production bin/delayed_job -i first --queues=job_1,job_2 stop')
        execute('cd #{current_path};RAILS_ENV=production bin/delayed_job -i second --queues=job_1,job_2 start')
      end
    end
  end
end

after 'deploy:publishing', 'delayed_job:restart'

As I have mentioned that I am running two seperate servers to manage delayed_jobs. On server 2 delayed_job.log file is not updated with latest logs. When I try to run delayed_job it executes on server 1 instead of server 2. Queues are running over server 2 to handle those jobs and when it runs on server 1 it couldn't find the exact source, which I am looking for to get executed.

share|improve this question
  • 1
    Seems unlikely that switching from passenger to puma has an effect on delayed_job. It is more likely that updating and changing capistrano recipes caused the issue. Can you please show the rake task you created and explain how you run it? Furthermore, did you check the servers if there are actually delayed_job workers running? Are there any relevant entries in your log files (deploy log, production/delayed-job log, server error log? – spickermann Feb 14 at 7:55
  • @spickermann Thanks for reply! I just updated question please take a look. – SSR Feb 14 at 9:29
  • @spickermann For logs : Yes I can see updated logs for production & deploy. I am also running Monit to handle delayed_jobs to start & stop. Even Monit it self fails to execute. – SSR Feb 14 at 9:29
  • @spickermann Did you see updates in question? I am using Apache + Puma. – SSR Feb 15 at 4:52

active oldest votes

Your Answer

StackExchange.ifUsing("editor", function () { StackExchange.using("externalEditor", function () { StackExchange.using("snippets", function () { StackExchange.snippets.init(); }); }); }, "code-snippets"); StackExchange.ready(function() { var channelOptions = { tags: "".split(" "), id: "1" }; initTagRenderer("".split(" "), "".split(" "), channelOptions); StackExchange.using("externalEditor", function() { // Have to fire editor after snippets, if snippets enabled if (StackExchange.settings.snippets.snippetsEnabled) { StackExchange.using("snippets", function() { createEditor(); }); } else { createEditor(); } }); function createEditor() { StackExchange.prepareEditor({ heartbeatType: 'answer', convertImagesToLinks: true, noModals: false, showLowRepImageUploadWarning: true, reputationToPostImages: 10, bindNavPrevention: true, postfix: "", onDemand: true, discardSelector: ".discard-answer" ,immediatelyShowMarkdownHelp:true }); } });
 
StackExchange.ready( function () { StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f48781530%2fdelayed-job-stopped-working-after-changing-server-from-passenger-to-puma%23new-answer', 'question_page'); } );

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged ruby-on-rails ruby ruby-on-rails-4 delayed-job or ask your own question.

StackExchange.ready(function(){$.get('/posts/48781530/ivc/3a21');});
StackExchange.ready(function () { StackExchange.responsiveness.addSwitcher(); }) (function(i, s, o, g, r, a, m) { i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function() { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m); })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga'); StackExchange.ready(function () { StackExchange.ga.init({ sendTitles: true, tracker: window.ga, trackingCodes: [ 'UA-108242619-1' ] }); StackExchange.ga.setDimension('dimension2', '|ruby-on-rails|ruby|ruby-on-rails-4|delayed-job|'); StackExchange.ga.setDimension('dimension3', 'Questions/Show'); StackExchange.ga.trackPageView(); }); /**/ var _qevents = _qevents || [], _comscore = _comscore || []; (function() { var ssl = 'https:' == document.location.protocol, s = document.getElementsByTagName('script')[0], qc = document.createElement('script'); qc.async = true; qc.src = (ssl ? 'https://secure' : 'http://edge') + '.quantserve.com/quant.js'; s.parentNode.insertBefore(qc, s); _qevents.push({ qacct: "p-c1rF4kxgLUzNc" }); /**/ var sc = document.createElement('script'); sc.async = true; sc.src = (ssl ? 'https://sb' : 'http://b') + '.scorecardresearch.com/beacon.js'; s.parentNode.insertBefore(sc, s); _comscore.push({ c1: "2", c2: "17440561" }); })();
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.622576 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO