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

Using JSON.parse in delete_by_value_ext break compatiblity with other Sidekiq extensions #220

Closed
dammer opened this issue May 3, 2017 · 2 comments

Comments

@dammer
Copy link

dammer commented May 3, 2017

We use gem sidekiq-marshal. It overrides the methods Sidekiq.load_json and Sidekiq.load_json in order to encode tasks in the format of the ruby Marshal.dump.

Using JSON.parse instead of Sidekiq.load_json here break compatibility with other Sidekiq extensions.

irb(main):001:0> ds = Sidekiq::DeadSet.new
=> #<Sidekiq::DeadSet:0x007ff0fa7edf90 @name="dead", @_size=2306>
irb(main):002:0> ds.size
=> 2306
irb(main):003:0> ds.clear
JSON::ParserError: 784: unexpected token at '{�I"
class�:�ETI"SkBuyData�;'
	from /skipped/ruby/2.2.0/gems/json-1.8.6/lib/json/common.rb:155:in `parse'
	from /skipped/ruby/2.2.0/gems/json-1.8.6/lib/json/common.rb:155:in `parse'
	from /skipped/ruby/2.2.0/gems/sidekiq-unique-jobs-4.0.18/lib/sidekiq_unique_jobs/sidekiq_unique_ext.rb:145:in `delete_by_value_ext'
	from /skipped/ruby/2.2.0/gems/sidekiq-4.2.9/lib/sidekiq/api.rb:400:in `delete'
	from /skipped/ruby/2.2.0/gems/sidekiq-unique-jobs-4.0.18/lib/sidekiq_unique_jobs/sidekiq_unique_ext.rb:17:in `delete_ext'
	from /skipped/ruby/2.2.0/gems/sidekiq-4.2.9/lib/sidekiq/api.rb:527:in `block in each'
	from /skipped/ruby/2.2.0/gems/sidekiq-4.2.9/lib/sidekiq/api.rb:526:in `each'
	from /skipped/ruby/2.2.0/gems/sidekiq-4.2.9/lib/sidekiq/api.rb:526:in `each'
	from /skipped/ruby/2.2.0/gems/sidekiq-unique-jobs-4.0.18/lib/sidekiq_unique_jobs/sidekiq_unique_ext.rb:140:in `clear_ext'
	from (skipped
	from /skipped/ruby/2.2.0/gems/railties-4.2.7.1/lib/rails/commands/console.rb:110:in `start'
	from /skipped/ruby/2.2.0/gems/railties-4.2.7.1/lib/rails/commands/console.rb:9:in `start'
	from /skipped/ruby/2.2.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:68:in `console'
	from /skipped/ruby/2.2.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
	from /skipped/ruby/2.2.0/gems/railties-4.2.7.1/lib/rails/commands.rb:17:in `<top (required)>'
	from bin/rails:4:in `require'
	from bin/rails:4:in `<main>'
@mhenrixon
Copy link
Owner

Try v5.0.8

@dammer
Copy link
Author

dammer commented May 3, 2017

Thank you, tested it in development everything works fine!
In production can not use v5.0.8 because redis version on server now is less than 3

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

No branches or pull requests

2 participants