Workers stopped getting enqueued...

56 views
Skip to first unread message

Mel Riffe

unread,
Oct 6, 2016, 5:46:29 PM10/6/16
to Sidekiq
Not sure how to debug this. On my staging server, it appears my workers are no longer getting enqueued.

config/sidekiq.yml:
---
:verbose: true
:concurrency: 5
:pidfile: tmp/pids/sidekiq.pid
:logfile: ./log/sidekiq.log

staging:
  :concurrency: 10

production:
  :concurrency: 20

:queues:
  - critical
  - default
  - low


my worker:
##
# Sidekiq Worker responsible for calling PgpKeyFingerprinter for the specified
# PgpKey and calling GreetingsGenerator for the specified account holder.
#
# This worker is initiated from CreateNewKey.
#
class GreetingsWorker
  include Sidekiq::Worker
  sidekiq_options queue: 'critical'

  def perform account_holder_id, pgp_key_id
    Rails.logger.info "[INFO] GreetingsWorker performing with argument 'account_holder_id' #{account_holder_id}, 'pgp_key_id' #{pgp_key_id}"
    pgp_key = PgpKey.find pgp_key_id
    PgpKeyFingerprinter.new( pgp_key ).assign
    account_holder = User.find account_holder_id
    GreetingsGenerator.new( account_holder ).send
  end

end


in rails console:
irb(main):013:0> GreetingsWorker.perform_async user.id, pgp_key.id
=> "5874dd2c051eb1451b00883a"
irb(main):014:0> stats = Sidekiq::Stats.new
=> #<Sidekiq::Stats:0x00000811026070 @stats={:processed=>0, :failed=>0, :scheduled_size=>0, :retry_size=>0, :dead_size=>0, :processes_size=>2, :default_queue_latency=>0, :workers_size=>0, :enqueued=>0}>
irb(main):015:0> queue = Sidekiq::Queue.new
=> #<Sidekiq::Queue:0x00000810ff0a38 @name="default", @rname="queue:default">
irb(main):016:0> queue.find_job "5874dd2c051eb1451b00883a"
=> nil
irb(main):017:0> queue = Sidekiq::Queue.new 'critical'
=> #<Sidekiq::Queue:0x00000810fcc5e8 @name="critical", @rname="queue:critical">
irb(main):018:0> queue.find_job "5874dd2c051eb1451b00883a"
=> nil
irb(main):019:0> queue = Sidekiq::Queue.new 'low'
=> #<Sidekiq::Queue:0x00000810f993c8 @name="low", @rname="queue:low">
irb(main):020:0> queue.find_job "5874dd2c051eb1451b00883a"
=> nil
irb(main):021:0>



During my tests I was tailing both my staging log and sidekiq log. I restarted sidekiq just to be sure it was up and running. I flushed my redis datastore. I ensured there was only 1 instance of the sidekiq process running. I double-, triple-checked my 'rspec-sidekiq' gem was defined in the test group.

Nothing. No output in the sidekiq log. No output in the staging log. (I verified file permissions too).

From the rails console session it appears a Job ID is generated and returned. Yet, I can not locate it in the 'critical' queue (like I expected), or the other defined queues.

What other items can I check to help run this down?

Thank you very much, in advance, for any assistance provided.

--Mel

Mel Riffe

unread,
Oct 6, 2016, 5:54:16 PM10/6/16
to Sidekiq
Not sure if this has any bearing, but my sidekiq-cron jobs appear to work as expected.

--Mel

Mike Perham

unread,
Oct 6, 2016, 5:57:45 PM10/6/16
to sid...@googlegroups.com
Use redis-cli monitor to verify the job is getting to redis. 

Mike
--
You received this message because you are subscribed to the Google Groups "Sidekiq" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sidekiq+u...@googlegroups.com.
To post to this group, send email to sid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sidekiq/ce9ea390-38e7-409b-b177-9bf13a6a31c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mel Riffe

unread,
Oct 7, 2016, 9:41:42 AM10/7/16
to sid...@googlegroups.com
Thanks for the suggestion, Mike. Turns out I _did_ have another sidekiq process running.

I learned 2 things: 1) redis-cli monitor is handy to know and provides a lot of output, and 2) I used the wrong command when searing for sidekiq processes.

FYI: I was using 'ps -aef | grep sidekiq' when I should have been using 'ps -aex | grep sidekiq'.

Thanks for your help!


To unsubscribe from this group and stop receiving emails from it, send an email to sidekiq+unsubscribe@googlegroups.com.

To post to this group, send email to sid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sidekiq/ce9ea390-38e7-409b-b177-9bf13a6a31c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Sidekiq" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sidekiq/eZMISzRUwEE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sidekiq+unsubscribe@googlegroups.com.

To post to this group, send email to sid...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages