Giter Site home page Giter Site logo

Delayed jobs with resque-web about jesque HOT 7 CLOSED

tomhaigh avatar tomhaigh commented on August 15, 2024
Delayed jobs with resque-web

from jesque.

Comments (7)

gresrun avatar gresrun commented on August 15, 2024

Hmm, I'm not sure what the issue is from your description. Are there any errors that resque-web emits?

from jesque.

tomhaigh avatar tomhaigh commented on August 15, 2024

The error I am getting from resque-web is:

x.sparkol.local - - [03/Mar/2015:14:04:01 GMT Standard Time] "GET / HTTP/1.1" 302 0
- -> /
Redis::CommandError - ERR Operation against a key holding the wrong kind of value:
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:113:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/redis-3.2.1/lib/redis.rb:964:in `block in llen'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/redis-3.2.1/lib/redis.rb:37:in `block in synchronize'
        C:/Ruby21/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/redis-3.2.1/lib/redis.rb:37:in `synchronize'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/redis-3.2.1/lib/redis.rb:963:in `llen'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/redis-namespace-1.5.1/lib/redis/namespace.rb:392:in `call_with_namespace'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/redis-namespace-1.5.1/lib/redis/namespace.rb:289:in `method_missing'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/resque-1.26.pre.0/lib/resque.rb:230:in `size'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/resque-1.26.pre.0/lib/resque/server/views/queues.erb:40:in `block (2 levels) in singleton class'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/resque-1.26.pre.0/lib/resque/server/views/queues.erb:37:in `each'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/resque-1.26.pre.0/lib/resque/server/views/queues.erb:37:in `block in singleton class'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/resque-1.26.pre.0/lib/resque/server/views/queues.erb:131067:in `instance_eval'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/resque-1.26.pre.0/lib/resque/server/views/queues.erb:131067:in `singleton class'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/resque-1.26.pre.0/lib/resque/server/views/queues.erb:131065:in `__tilt_29389152'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `evaluate'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:814:in `render'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:665:in `erb'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/resque-1.26.pre.0/lib/resque/server.rb:120:in `partial'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/resque-1.26.pre.0/lib/resque/server/views/overview.erb:1:in `block in singleton class'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/resque-1.26.pre.0/lib/resque/server/views/overview.erb:131067:in `instance_eval'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/resque-1.26.pre.0/lib/resque/server/views/overview.erb:131067:in `singleton class'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/resque-1.26.pre.0/lib/resque/server/views/overview.erb:131065:in `__tilt_29389152'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `evaluate'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:814:in `render'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:665:in `erb'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/resque-1.26.pre.0/lib/resque/server.rb:139:in `show'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/resque-1.26.pre.0/lib/resque/server.rb:168:in `block (2 levels) in <class:Server>'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `block in compile!'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `[]'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (3 levels) in route!'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:985:in `route_eval'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (2 levels) in route!'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1006:in `block in process_route'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `catch'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `process_route'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:964:in `block in route!'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `each'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `route!'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1076:in `block in dispatch!'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1073:in `dispatch!'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `block in call!'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `call!'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:886:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/rack-1.6.0/lib/rack/nulllogger.rb:9:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/rack-1.6.0/lib/rack/head.rb:13:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/show_exceptions.rb:21:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:180:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:2014:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `block in call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1788:in `synchronize'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/rack-1.6.0/lib/rack/handler/webrick.rb:89:in `service'
        C:/Ruby21/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
        C:/Ruby21/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
        C:/Ruby21/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'
[2015-03-03 14:04:02] ERROR NoMethodError: undefined method `join' for #<String:0x4237020>
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/show_exceptions.rb:37:in `rescue in call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/show_exceptions.rb:21:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:180:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:2014:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `block in call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1788:in `synchronize'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `call'
        C:/Ruby21/lib/ruby/gems/2.1.0/gems/rack-1.6.0/lib/rack/handler/webrick.rb:89:in `service'
        C:/Ruby21/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
        C:/Ruby21/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
        C:/Ruby21/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'

It all works fine until I call client.delayedEnqueue() .

from jesque.

gresrun avatar gresrun commented on August 15, 2024

OK, looks like redis.rb is trying to call llen() on a non-list key (likely the sorted set used as the data structure for delayed queues) while getting the size of each of the queues.

I'm not sure why this is happening in resque-web, since I don't have tremendous knowledge of that software, but jesque-web should handle this case. If you encounter similar issues in jesque-web, I can do something about it.

from jesque.

gresrun avatar gresrun commented on August 15, 2024

@tomhaigh Does this work correctly in Jesque-Web?

from jesque.

tomhaigh avatar tomhaigh commented on August 15, 2024

Sorry, yes it doesn't cause any problems there, so I can use that instead. It just seems odd because I thought the redis data format was compatible between resque and jesque.

Thanks for looking at it

from jesque.

gresrun avatar gresrun commented on August 15, 2024

After digging a bit more into the resque-scheduler implementation, it does appear that the delayed jobs feature is implemented quite differently in Jesque.

Basically, resque-scheduler clients add delayed jobs by appending job information into three data structures (a list, a set and and a zset) and then has at least one dedicated scheduler that enqueues those delayed jobs into normal queues (Redis lists) at the desired time and then workers pull off that job. This is quite different from Jesque's approach, in which clients immediately enqueue a job into a special delayed queue (a Redis zset) and workers pull off jobs from that delayed queue whose time has come to pass.

The resque-scheduler approach is quite a bit more complicated, requiring four Redis keys (two lists, a set and a zset) to enqueue a delayed job, and requires a scheduler must be running at the time the delayed job is ready in order to enqueue it into a regular queue. While I was not the original author of the delayed job feature (@anismiles was the initial contributor), I feel the feature's incompatibility with resque-scheduler is acceptable given the benefits of simplicity and reliability of Jesque's current implementation of delayed queues.

from jesque.

gresrun avatar gresrun commented on August 15, 2024

FYI, I added a note to the README regarding the incompatibility with resque-scheduler.

from jesque.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.