1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
Commit graph

4 commits

Author SHA1 Message Date
Vladimir Dementyev
2cb2357d39 Let's use Rubocop! (#1325)
* Add limited rubocop config and TODO config

* Remove trailing whitespaces and blanklines

* Add rubocop rake task; upd travis.yml
2017-06-04 13:21:05 -07:00
eileencodes
bebdf266e5 Only write if file doesn't exist
Before this fix if you have an application that uses Puma and this
plugin it is impossible to start 2 servers at once even if they are
using separate pidfiles and ports. The reason is because this plugin
will overwrite the pidfiles no matter.

To reproduce:

Start a regular Rails server which points to the pidfile in
`tmp/pids/server.pid`

```
rails s
```

Start a second Rails server which points to a new pidfile and port

```
rails s -p 4000 -P tmp/pids/new_server.pid
```

The first server will be stopped and claim that the pid is being used by
another process.

What really is happening is the restart plugin is writing over the
original pidfile which stops the server.

If we check the file exists first this will prevent the problem from
occuring. Touching tmp/restart.txt will still work but starting a
separate process with it's own pidfile should not interfere with other
running servers in the same app.
2017-03-09 15:19:50 -05:00
Evan Phoenix
a57b166309 Harden tmp_restart against errors related to the restart file 2016-02-26 10:11:59 -08:00
Evan Phoenix
663666c5b7 Add plugin mechanism and initial plugin 2016-02-06 22:28:02 -08:00