Git Product home page Git Product logo

Comments (7)

Earlopain avatar Earlopain commented on May 25, 2024 1

I've read a bit about it since I find this a very interesting optimization and at least in webservers compaction can lead to bugs.

I'm uncertain if sidekiq would encounter similar troubles since it doesn't fork by itself. Enterprise is different I think (optionally).

from sidekiq.

mperham avatar mperham commented on May 25, 2024

You can disable warmup by calling cli.run(warmup: false) in bin/sidekiq. I don't see a need to make it any easier but you're welcome to make the case if you feel otherwise.

from sidekiq.

dgollahon avatar dgollahon commented on May 25, 2024

You can disable warmup by calling cli.run(warmup: false) in bin/sidekiq.

Sorry, when you say calling that in bin/sidekiq how do you suggest users do that? Are you suggesting I edit the sidekiq "binary" to change this and/or fork sidekiq? I would assume most people would launch sidekiq like the docs show by calling the executable and optionally passing it a config file: https://github.com/sidekiq/sidekiq/wiki/Advanced-Options#the-sidekiq-configuration-file

from sidekiq.

mperham avatar mperham commented on May 25, 2024

Copy bin/sidekiq to bin/sidekiqcold in your app, add the flag and run your testing. You’re just hacking this together to debug.

from sidekiq.

dgollahon avatar dgollahon commented on May 25, 2024

You’re just hacking this together to debug.

I am suggesting this as a long-term opt-out which I think people would like to be able to do (at least, I would like to be able to do--particularly deploying in this state) but I can work around this...

It just seems slightly aggressive to turn it on by default and not have an opt-out other than doing something very strange/hacky. That's just my $0.02.

from sidekiq.

mperham avatar mperham commented on May 25, 2024

I don't think of it as aggressive at all. Ruby documented its purpose and I don't recall hearing any drawbacks or danger in doing so. I added that warmup flag to be cautious but I don't think it's a good idea for anyone to opt-out long-term. It's a valuable point in time for the Ruby runtime to perform optimizations.

from sidekiq.

andrewhampton avatar andrewhampton commented on May 25, 2024

Our investigation is still underway, but we started seeing an issue in production where turning this off seems to have solved our problem.

We started seeing an issue where LaunchDarkly API calls would return FLAG_NOT_FOUND errors. It's still not clear to us if turning this off actually fixes the issue, or just changes timings enough to sidestep some race condition.

I agree that no opt-out makes sense if this is a stable change for most people. So just leaving a comment here as a single counter-example.

Also, just in case anyone else runs into this and needs to maintain a custom copy of bin/sidekiq, here's a spec that will fail when a release comes out with bin/sidekiq changes:

require 'rails_helper'

describe 'sidekq binary' do
  it 'should match the last validated file hash' do
    # last verified md5 hash of the sidekiq bin file
    expected_hash_value = "63e6c20e28e96a92442bf795998d4093"

    # get the sidekiq gem path using bundler
    bin_path = "#{Bundler.rubygems.find_name('sidekiq').first.full_gem_path}/bin/sidekiq"
    current_hash_value = Digest::MD5.file(bin_path).hexdigest

    # If this test fails, it means the last known MD5 hash value for the sidekiq bin file has changed.
    # This likely means the sidekiq bin file in our bin/ directory is out of date.
    # To fix this, you'll need to go assess the changes to the sidekiq version of the bin file
    # and make the appropriate updates to our bin file. After that, update the
    # expected_hash_value above to match the new file.
    expect(current_hash_value).to eq(expected_hash_value)
  end
end

from sidekiq.

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.