Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store gush jobs on redis hash instead of plain keys #56

Merged
merged 1 commit into from
Aug 13, 2018

Conversation

Saicheg
Copy link
Contributor

@Saicheg Saicheg commented Jul 10, 2018

As discussed on #55

@Saicheg
Copy link
Contributor Author

Saicheg commented Jul 12, 2018

@pokonski any updates on this?

@pokonski
Copy link
Contributor

@Saicheg I haven't forgotten, but will have a look over the weekend and test it personally :)

@Saicheg
Copy link
Contributor Author

Saicheg commented Jul 18, 2018

@pokonski UP on this

@pokonski
Copy link
Contributor

I tested this and works fine! This will be marked under 2.0

@pokonski pokonski merged commit 3d906fe into chaps-io:master Aug 13, 2018
@gbrlcustodio
Copy link

Has version 2 release already been scheduled?

@pokonski
Copy link
Contributor

Hey @gbrlcustodio, super busy with work currently, but I expect to have more time for this next week. Thanks for the reminder!

@pokonski
Copy link
Contributor

pokonski commented Nov 22, 2018

@gbrlcustodio
Copy link

Thanks @pokonski

@gbrlcustodio
Copy link

Folks, what are the breaking changes introduced by this PR? Is there a migration path to follow? I've just upgraded and cleaned my redis cache and I'm getting Redis::CommandError: WRONGTYPE Operation against a key holding the wrong kind of value.

@pokonski @Saicheg

@pokonski
Copy link
Contributor

Can you share a full stack trace?

@gbrlcustodio
Copy link

2018-11-22T20:09:35.096Z 24471 TID-gqn6hyycj Gush::Worker JID-d1c366f1adb8ab2412ca323c INFO: fail: 0.005 sec
2018-11-22T20:09:35.096Z 24471 TID-gqn6hyycj WARN: {"context":"Job raised exception","job":{"class":"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper","wrapped":"Gush::Worker","queue":"gush","args":[{"job_class":"Gush::Worker","job_id":"7f414fc2-cf18-4136-82d6-79ca0ba84611","provider_job_id":null,"queue_name":"gush","priority":null,"arguments":["6292e226-9f3c-43b6-b1b6-0d9c42406d2f","Nuntec::SyncFuelsJob-c1da8c38-4edc-4b43-832d-5a6ffaaac6a2"],"executions":0,"locale":"pt-BR"}],"retry":true,"jid":"d1c366f1adb8ab2412ca323c","created_at":1542917375.0839489,"enqueued_at":1542917375.083996},"jobstr":"{\"class\":\"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper\",\"wrapped\":\"Gush::Worker\",\"queue\":\"gush\",\"args\":[{\"job_class\":\"Gush::Worker\",\"job_id\":\"7f414fc2-cf18-4136-82d6-79ca0ba84611\",\"provider_job_id\":null,\"queue_name\":\"gush\",\"priority\":null,\"arguments\":[\"6292e226-9f3c-43b6-b1b6-0d9c42406d2f\",\"Nuntec::SyncFuelsJob-c1da8c38-4edc-4b43-832d-5a6ffaaac6a2\"],\"executions\":0,\"locale\":\"pt-BR\"}],\"retry\":true,\"jid\":\"d1c366f1adb8ab2412ca323c\",\"created_at\":1542917375.0839489,\"enqueued_at\":1542917375.083996}"}
2018-11-22T20:09:35.096Z 24471 TID-gqn6hyycj WARN: Redis::CommandError: WRONGTYPE Operation against a key holding the wrong kind of value
2018-11-22T20:09:35.096Z 24471 TID-gqn6hyycj WARN: /home/gabriel/.rvm/gems/ruby-2.4.4/gems/redis-4.0.2/lib/redis/client.rb:119:in `call'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/redis-4.0.2/lib/redis.rb:2068:in `block in hget'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/redis-4.0.2/lib/redis.rb:45:in `block in synchronize'
/home/gabriel/.rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/redis-4.0.2/lib/redis.rb:45:in `synchronize'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/redis-4.0.2/lib/redis.rb:2067:in `hget'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/gush-2.0.0/lib/gush/client.rb:176:in `block in find_job_by_klass_and_id'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/connection_pool-2.2.2/lib/connection_pool.rb:65:in `block (2 levels) in with'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/connection_pool-2.2.2/lib/connection_pool.rb:64:in `handle_interrupt'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/connection_pool-2.2.2/lib/connection_pool.rb:64:in `block in with'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/connection_pool-2.2.2/lib/connection_pool.rb:61:in `handle_interrupt'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/connection_pool-2.2.2/lib/connection_pool.rb:61:in `with'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/gush-2.0.0/lib/gush/client.rb:175:in `find_job_by_klass_and_id'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/gush-2.0.0/lib/gush/client.rb:123:in `find_job'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/gush-2.0.0/lib/gush/worker.rb:35:in `setup_job'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/gush-2.0.0/lib/gush/worker.rb:7:in `perform'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activejob-5.2.1/lib/active_job/execution.rb:39:in `block in perform_now'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:109:in `block in run_callbacks'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/i18n-1.1.0/lib/i18n.rb:284:in `with_locale'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activejob-5.2.1/lib/active_job/translation.rb:9:in `block (2 levels) in <module:Translation>'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in `instance_exec'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activejob-5.2.1/lib/active_job/logging.rb:26:in `block (4 levels) in <module:Logging>'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/notifications.rb:168:in `block in instrument'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/notifications.rb:168:in `instrument'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activejob-5.2.1/lib/active_job/logging.rb:25:in `block (3 levels) in <module:Logging>'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activejob-5.2.1/lib/active_job/logging.rb:46:in `block in tag_logger'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/tagged_logging.rb:71:in `block in tagged'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/tagged_logging.rb:28:in `tagged'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/tagged_logging.rb:71:in `tagged'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activejob-5.2.1/lib/active_job/logging.rb:46:in `tag_logger'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activejob-5.2.1/lib/active_job/logging.rb:22:in `block (2 levels) in <module:Logging>'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in `instance_exec'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:136:in `run_callbacks'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activejob-5.2.1/lib/active_job/execution.rb:35:in `perform_now'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activejob-5.2.1/lib/active_job/execution.rb:24:in `block in execute'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:109:in `block in run_callbacks'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activejob-5.2.1/lib/active_job/railtie.rb:28:in `block (4 levels) in <class:Railtie>'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/execution_wrapper.rb:87:in `wrap'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/reloader.rb:73:in `block in wrap'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/execution_wrapper.rb:83:in `wrap'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/reloader.rb:72:in `wrap'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activejob-5.2.1/lib/active_job/railtie.rb:27:in `block (3 levels) in <class:Railtie>'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in `instance_exec'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:136:in `run_callbacks'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activejob-5.2.1/lib/active_job/execution.rb:22:in `execute'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activejob-5.2.1/lib/active_job/queue_adapters/sidekiq_adapter.rb:42:in `perform'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/processor.rb:185:in `execute_job'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/processor.rb:167:in `block (2 levels) in process'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/middleware/chain.rb:128:in `block in invoke'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/middleware/chain.rb:133:in `invoke'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/processor.rb:166:in `block in process'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/processor.rb:137:in `block (6 levels) in dispatch'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/job_retry.rb:98:in `local'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/processor.rb:136:in `block (5 levels) in dispatch'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/rails.rb:42:in `block in call'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/execution_wrapper.rb:87:in `wrap'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/reloader.rb:73:in `block in wrap'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/execution_wrapper.rb:87:in `wrap'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/activesupport-5.2.1/lib/active_support/reloader.rb:72:in `wrap'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/rails.rb:41:in `call'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/processor.rb:132:in `block (4 levels) in dispatch'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/processor.rb:243:in `stats'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/processor.rb:127:in `block (3 levels) in dispatch'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/job_logger.rb:8:in `call'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/processor.rb:126:in `block (2 levels) in dispatch'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/job_retry.rb:73:in `global'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/processor.rb:125:in `block in dispatch'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/logging.rb:48:in `with_context'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/logging.rb:42:in `with_job_hash_context'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/processor.rb:124:in `dispatch'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/processor.rb:165:in `process'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/processor.rb:83:in `process_one'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/processor.rb:71:in `run'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/util.rb:16:in `watchdog'
/home/gabriel/.rvm/gems/ruby-2.4.4/gems/sidekiq-5.2.2/lib/sidekiq/util.rb:25:in `block in safe_thread'

@pokonski
Copy link
Contributor

On first sight it looks like it tries to execute a job from old data structure. Did you clean all sidekiq jobs and workflows?

@gbrlcustodio
Copy link

My fault, forgot to reload the rails console, thanks dude

@pokonski
Copy link
Contributor

No worries, glad it wasn't a bug 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants