GithubHelp home page GithubHelp logo

Comments (15)

utgarda avatar utgarda commented on May 26, 2024

The only explanation to including client middleware in server config that I found is "… so that jobs created by jobs have status" 2fa8ab1

Did you try without it?

Also, would you be so kind to run the gem's tests on your setup?

from sidekiq-status.

ericpeters0n avatar ericpeters0n commented on May 26, 2024

Huh? Isn't that just standard setup for Sidekiq::Status? Did I totally misunderstand the docs?

from sidekiq-status.

utgarda avatar utgarda commented on May 26, 2024

Disregarding the docs, which eventually need correction, did it work for you the other way? And what do specs show on your system?

from sidekiq-status.

ericpeters0n avatar ericpeters0n commented on May 26, 2024

Down a different rabbit hole atm; will test and follow up later this eve. Thanks for the quick responses, @utgarda.

from sidekiq-status.

ericpeters0n avatar ericpeters0n commented on May 26, 2024

Updated sidekiq.rb per your comment, but no change in behavior resulted:

require 'sidekiq'
require 'sidekiq-status'

Sidekiq.configure_client do |config|
  config.redis = { :url => ENV["REDISTOGO_URL"], :size => 1 }
  # sidekiq-status
  config.client_middleware do |chain|
    chain.add Sidekiq::Status::ClientMiddleware
  end
  #
end

Sidekiq.configure_server do |config|
  config.redis = { :url => ENV["REDISTOGO_URL"], :size => 2 }
  # sidekiq-status
  config.server_middleware do |chain|
    chain.add Sidekiq::Status::ServerMiddleware, expiration: 30.minutes # default
  end
  # config.client_middleware do |chain|
  #   chain.add Sidekiq::Status::ClientMiddleware
  # end
  #
end

from sidekiq-status.

ericpeters0n avatar ericpeters0n commented on May 26, 2024

Forking the sidekiq-status repo locally and running 'rake spec' fails spectacularly... but this seems to clearly be a configuration issue for running the tests:

bash-3.2$ rake spec
/Users/Eric/.rvm/rubies/ruby-1.9.2-p320/bin/ruby -S rspec ./spec/lib/sidekiq-status/client_middleware_spec.rb ./spec/lib/sidekiq-status/server_middleware_spec.rb ./spec/lib/sidekiq-status/testing_spec.rb ./spec/lib/sidekiq-status/worker_spec.rb ./spec/lib/sidekiq-status_spec.rb

Sidekiq::Status::ClientMiddleware
  #call
2014-08-10T03:35:03Z 53579 TID-zl6kp8 INFO: Sidekiq client using redis://localhost:6379/0 with options {}
    sets queued status (FAILED - 1)
    sets status hash ttl (FAILED - 2)
    when redis_pool passed
      uses redis_pool (FAILED - 3)
    when redis_pool is not passed
      uses Sidekiq.redis (FAILED - 4)

Sidekiq::Status::ServerMiddleware
  #call
    sets working/complete status (FAILED - 5)
    sets failed status (FAILED - 6)
    sets status hash ttl (FAILED - 7)
  :expiration parameter
    overwrites default expiry value (FAILED - 8)
    can be overwritten by worker expiration method (FAILED - 9)

Sidekiq::Status
  .status
    bypasses redis with inlining enabled

Sidekiq::Status::Worker
  .perform_async
    generates and returns job id (FAILED - 10)
  .expiration
    allows to set/get expiration

Sidekiq::Status
  .status, .working?, .complete?
    gets job status by id as symbol (FAILED - 11)
  .get
    gets a single value from data hash as string (FAILED - 12)
  .at, .total, .pct_complete, .message
    should return job progress with correct type to it (FAILED - 13)
  .get_all
    gets the job hash by id (FAILED - 14)
  .cancel
    cancels a job by id (FAILED - 15)
    does not cancel a job with correct id but wrong time (FAILED - 16)
  keeps normal Sidekiq functionality
    does jobs with and without included worker module (FAILED - 17)
    retries failed jobs (FAILED - 18)
    :expiration param
      allow to overwrite :expiration parameter (FAILED - 19)
      allow to overwrite :expiration parameter by .expiration method from worker (FAILED - 20)

Failures:

  1) Sidekiq::Status::ClientMiddleware#call sets queued status
     Failure/Error: allow(SecureRandom).to receive(:hex).once.and_return(job_id)
     NoMethodError:
       undefined method `allow' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x00000101459ff0>
     # ./spec/lib/sidekiq-status/client_middleware_spec.rb:13:in `block (3 levels) in <top (required)>'

  2) Sidekiq::Status::ClientMiddleware#call sets status hash ttl
     Failure/Error: allow(SecureRandom).to receive(:hex).once.and_return(job_id)
     NoMethodError:
       undefined method `allow' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x000001015ed330>
     # ./spec/lib/sidekiq-status/client_middleware_spec.rb:20:in `block (3 levels) in <top (required)>'

  3) Sidekiq::Status::ClientMiddleware#call when redis_pool passed uses redis_pool
     Failure/Error: allow(redis_pool).to receive(:with)
     NoMethodError:
       undefined method `allow' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1::Nested_1:0x00000101603720>
     # ./spec/lib/sidekiq-status/client_middleware_spec.rb:28:in `block (4 levels) in <top (required)>'

...

Not sure what I'm doing wrong here... Thanks for your help @utgarda

from sidekiq-status.

ericpeters0n avatar ericpeters0n commented on May 26, 2024

Concurrently, sidekiq-server sits idly by:

bash-3.2$ bundle exec sidekiq --PID sidekiq.pid
2014-08-10T03:34:55Z 53563 TID-zl6kp8 INFO: Booting Sidekiq 2.12.4 using redis://feng-shui.local:6379 with options {:size=>2}
2014-08-10T03:34:55Z 53563 TID-zl6kp8 INFO: Running in ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-darwin10.8.0]
2014-08-10T03:34:55Z 53563 TID-zl6kp8 INFO: See LICENSE and the LGPL-3.0 for licensing details.
2014-08-10T03:34:55Z 53563 TID-zl6kp8 INFO: Starting processing, hit Ctrl-C to stop

Is the fact that I'm running sidekiq v2 of consequence to sidekiq-status?

from sidekiq-status.

ericpeters0n avatar ericpeters0n commented on May 26, 2024

Note: This is evidenced on a system that is running numerous Sidekiq workers flawlessly, so it seems that there's some gap in either the instructions/docs for sidekiq-status, or the gem makes some assumptions about the platform that aren't necessarily valid.

Or I'm doing something dumb... :) Please advise.

Thanks!

from sidekiq-status.

utgarda avatar utgarda commented on May 26, 2024

Is it possible that you run more than one redis instance and have them intermixed somewhere in configuration ( say, default port in one place and non-default in another) ? Could you please run those specs once more without concurrently running a sidekiq-server ( though yours shows it doesn't interfere, but still ).

Also, seems you're running a different version of rake than me. Sorry, dev dependencies are not so strictly written, see this:

gem.add_development_dependency      'rake'
gem.add_development_dependency      'rspec'

so please try this one

> rake2.0 --version
rake, version 10.3.2

also, could you forget bundle update?

from sidekiq-status.

ericpeters0n avatar ericpeters0n commented on May 26, 2024

I have not had the bandwidth to troubleshoot it further than just running the tests —which failed spectacularly. It’s evident that the gem makes some assumptions about standard configuration that aren’t met in my case, despite the fact that I’m using a pretty paint-by-numbers redis and sidekiq config. I’ll be sure to follow up when I loop back around to this eventually, but I was obliged to brute force a workaround to my functional requirements in the meantime.

On Thursday, September 4, 2014 at 11:05 PM, Jake wrote:

@ericpeters0n (https://github.com/ericpeters0n) Did you ever get this sorted out? I'm running into a similar issue - workers are doing work but status is always "queued", pct_complete is always NaN, and at is always 0.
I don't have much experience working with gems. I tried forking to run the gem's tests locally and it gets hung up on Sidekiq::Status::ServerMiddleware#call.


Reply to this email directly or view it on GitHub (#37 (comment)).

from sidekiq-status.

jakegavin avatar jakegavin commented on May 26, 2024

Sorry for the confusion. I deleted my original comment because I realized the error was a mistake in my configuration. The gem is working well for me now. Thanks!

from sidekiq-status.

pramodshinde avatar pramodshinde commented on May 26, 2024

@ericpeters0n & @jakegavin can you confirm if this has been resolved?

from sidekiq-status.

ericpeters0n avatar ericpeters0n commented on May 26, 2024

I was obliged to work around this issue (~1yr ago).

Will see if there's a simple way to retest, but no, there was no resolution.

On Dec 24, 2015, at 8:20 AM, Pramod Shinde [email protected] wrote:

@ericpeters0n & @jakegavin can you confirm if this has been resolved?


Reply to this email directly or view it on GitHub.

from sidekiq-status.

jakegavin avatar jakegavin commented on May 26, 2024

I'm no longer using this gem but if I recall correctly, I wasn't having any issues with it. My switch to a different solution was the result of a cleaner approach to the business problem, nothing specifically related to this gem.

Thanks for the work you put into maintaining it!

from sidekiq-status.

pramodshinde avatar pramodshinde commented on May 26, 2024

👍 Great!

from sidekiq-status.

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.