I have a problem with sidekiq,
On my local env, when I already have some jobs in queue and I start sidekiq, bundle exec sidekiq, these jobs start but never finish (see example below). These jobs should be done in max 1 or 2 seconds). It seems to happen with every jobs, not specifically with the example's one.
It forces me to close sidekiq and flush redis $redis.flushall. Then I restart rails THEN I restart sidekiq and THEN I enque new jobs, it works...
Do you have any idea of what's happening?
Thanks in advance!
My environment
- ruby 2.6.0
- sidekiq 6.0.6
- Rails 6.0.2.1
Example
My job:
# frozen_string_literal: true
class UpdateVariantInDraftOrdersJob
include Sidekiq::Worker
def perform(variant_id)
puts 'UpdateVariantInDraftOrdersJob start'
# do the job
puts 'UpdateVariantInDraftOrdersJob end'
end
end
bundle exec sidekiq
m,
`$b
.ss, $$: .,d$
`$$P,d$P' .,md$P"'
,$$$$$b/md$$$P^'
.d$$$$$$/$$$P'
$$^' `"/$$$' ____ _ _ _ _
$: ,$$: / ___|(_) __| | ___| | _(_) __ _
`b :$$ \___ \| |/ _` |/ _ \ |/ / |/ _` |
$$: ___) | | (_| | __/ <| | (_| |
$$ |____/|_|\__,_|\___|_|\_\_|\__, |
.d$$ |_|
2020-03-26T09:27:10.758Z pid=79574 tid=oui10vpii INFO: Booted Rails 6.0.2.1 application in development environment
2020-03-26T09:27:10.759Z pid=79574 tid=oui10vpii INFO: Running in ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin17]
2020-03-26T09:27:10.759Z pid=79574 tid=oui10vpii INFO: See LICENSE and the LGPL-3.0 for licensing details.
2020-03-26T09:27:10.760Z pid=79574 tid=oui10vpii INFO: Upgrade to Sidekiq Pro for more features and support: http://sidekiq.org
2020-03-26T09:27:10.761Z pid=79574 tid=oui10vpii INFO: Booting Sidekiq 6.0.6 with redis options {:id=>"Sidekiq-server-PID-79574", :url=>nil}
2020-03-26T09:27:10.776Z pid=79574 tid=oui10vpii INFO: Starting processing, hit Ctrl-C to stop
2020-03-26T09:27:10.805Z pid=79574 tid=oui1srrua class=UpdateVariantInDraftOrdersJob jid=7d9ff854d1cbd8f127385faf INFO: start
2020-03-26T09:27:10.808Z pid=79574 tid=oui1srs5a class=UpdateVariantInDraftOrdersJob jid=7b0aca12380f5214baa90c46 INFO: start
^C2020-03-26T09:28:51.868Z pid=79574 tid=oui10vpii INFO: Shutting down
2020-03-26T09:28:51.868Z pid=79574 tid=oui10vpii INFO: Terminating quiet workers
2020-03-26T09:28:51.872Z pid=79574 tid=oui1srrf6 INFO: Scheduler exiting...
2020-03-26T09:28:51.980Z pid=79574 tid=oui10vpii INFO: Pausing to allow workers to finish...
2020-03-26T09:29:16.842Z pid=79574 tid=oui10vpii WARN: Terminating 2 busy worker threads
2020-03-26T09:29:16.842Z pid=79574 tid=oui10vpii WARN: Work still in progress [#<struct Sidekiq::BasicFetch::UnitOfWork queue="queue:default", job="{\"retry\":true,\"queue\":\"default\",\"class\":\"UpdateVariantInDraftOrdersJob\",\"args\":[2209],\"jid\":\"7d9ff854d1cbd8f127385faf\",\"created_at\":1585048833.1967769,\"enqueued_at\":1585048833.196963}">, #<struct Sidekiq::BasicFetch::UnitOfWork queue="queue:default", job="{\"retry\":true,\"queue\":\"default\",\"class\":\"UpdateVariantInDraftOrdersJob\",\"args\":[2209],\"jid\":\"7b0aca12380f5214baa90c46\",\"created_at\":1585048838.899363,\"enqueued_at\":1585048838.899456}">]
2020-03-26T09:29:16.846Z pid=79574 tid=oui10vpii INFO: Pushed 2 jobs back to Redis
2020-03-26T09:29:16.898Z pid=79574 tid=oui10vpii INFO: Bye!