untitledkingdom / mina-puma

Puma tasks for Mina
MIT License
84 stars 40 forks source link

restart and pased_restart do not work like stop and start #26

Open inyerade opened 6 years ago

inyerade commented 6 years ago

I do a new feature adding a new gem and when I want to deploy I execute mina deploy.

In the deploy the new gem install but the I get error when I go to a page where I use this gem. Then I do a mina puma:phased_restart and the behavor is the same. Then I do a mina puma:stop and a mina puma:start and work perfect

I do not know what is wrong

Feuda commented 5 years ago

@inyerade

Puma phased_restart has two requirements

  1. There are more than two workers, you are able to config it in puma.rb
  2. Enable prune_bundler in puma.rb

Important info https://github.com/puma/puma/blob/master/docs/restart.md

jmuheim commented 5 years ago

I spent hours debugging why deployment wouldn't work, then I finally stumbled over this.

I tried activating 3 workers in puma.rb:

workers ENV.fetch("WEB_CONCURRENCY") { 3 }

But didn't work for me. I just switched to puma:hard_restart in the deploy.rb config. Now it seems to work:

-----> Restart Puma -- hard...
-----> Stopping Puma...
       Puma is not running!
-----> Starting Puma...
       Puma starting in single mode...
       * Version 4.1.1 (ruby 2.4.1-p111), codename: Fourth and One
       * Min threads: 5, max threads: 5
       * Environment: production
       * Daemonizing...

By the way, puma:restart doesn't seem to work:

-----> Restart Puma....
       Puma is not running!

I feel this info should be added to the README.

jmuheim commented 5 years ago

PS: In the docs (https://github.com/puma/puma/blob/master/docs/restart.md), there is no "hard restart" mentioned. Is "hot restart" equivalent to "hard restart"? Or what's the difference?