Coder Social home page Coder Social logo

Comments (6)

ajgon avatar ajgon commented on June 11, 2024 1

I created a PR #282 to address this issue, can you please take a look if it works for you? If so, I'll merge it to the codebase and release a new version of the gem.

Thanks!

from opsworks_ruby.

kzkn avatar kzkn commented on June 11, 2024 1

@ajgon
Great, it works fine!

from opsworks_ruby.

kzkn avatar kzkn commented on June 11, 2024

This seems to be similar to the problem we addressed in #251.
Enviroment variables are embed in monitrc files. So environment variables change causes monit reload. If appserver and worker is used in a instance both, monit reload is called twice. One for appserver's monitrc, one for worker's monitrc.

In the log, the second Reinitializing Monit -- control file '/etc/monit/monitrc' cancels 'puma_rails' restart on user request.

from opsworks_ruby.

kzkn avatar kzkn commented on June 11, 2024

It seems to work if we use creates to limit the execution of monit reload to one time. Like this:

# configure.rb
every_enabled_application do |application|
  # snip

  timestamp = Time.now.to_i
  execute 'monit reload' do
    command "monit reload && touch /tmp/.monit-reload-#{timestamp}"
    action :nothing
    only_if 'which monit'
    creates "/tmp/.monit-reload-#{timestamp}"
  end
end

from opsworks_ruby.

kzkn avatar kzkn commented on June 11, 2024

@ajgon #282 does not work 😢 And I found a new issue #284.
Even if pumactl restart is successfully to run, it will not resolve #284.

I think it is not necessary to embed environment variables in monitrc for puma.

If we are using dot_env, it does not override environment variables already defined by default. If we set values in monitrc, puma worker processes will not reflect it even if the .env value changes.

If we do not include environment variables in monitrc, changes in .env values will be reflected to puma worker processes.

And puma's monitrc is not changed before/after the deploy which has the change of environment variables, it avoids monit reload for puma. Therefore, puma will restart even after a deployment in which environment variables have been changed. In other words, this issue (#281) is resolved.

My patch is here: kzkn@ba95731

from opsworks_ruby.

ajgon avatar ajgon commented on June 11, 2024

@kzkn I added your patch here: b6fa01f - would it work for you?

from opsworks_ruby.

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.