Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rails dev:cache failed to restart the Rails server with custom pid file path #29306

Closed
ranmocy opened this issue Jun 1, 2017 · 4 comments
Closed
Labels

Comments

@ranmocy
Copy link

ranmocy commented Jun 1, 2017

Steps to reproduce

  1. Start rails server with a custom pid file: rails s -P tmp/pids/dev.pid.
  2. Toggle dev cache: rails dev:cache.

Expected behavior

Rails server should be restarted successfully.

Actual behavior

Restarting failed. Log:

=> Booting Puma
=> Rails 5.1.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.8.2 (ruby 2.3.3-p222), codename: Sassy Salamander
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
* Restarting...
=> Booting Puma
=> Rails 5.1.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
A server is already running. Check /tmp/rails-test/tmp/pids/dev.pid.
Exiting

System configuration

Rails version: Rails 5.1.1

Ruby version: Ruby 2.3.3

Potential Reason

  1. The pid file path is hard coded in dev_caching.rb as "tmp/pids/server.pid"
  2. When restarting rails with Puma, it won't remove the pid file it generated.
@skunkworker
Copy link

Doing a search for "tmp/pids/server.pid" I can find that it is being hardcoded multiple places - search, even though server_command.rb has that set to be the default location, it allows for other settings.

Is there a reason why a disparity exists?

@prathamesh-sonpatki prathamesh-sonpatki self-assigned this Jun 5, 2017
@prathamesh-sonpatki
Copy link
Member

Looking into this.

@y-yagi
Copy link
Member

y-yagi commented Aug 19, 2017

@prathamesh-sonpatki Are you working on this? If not, I will fix.

@prathamesh-sonpatki
Copy link
Member

@y-yagi No, I am not working on it, feel free to take a stab at it, thanks :)

@prathamesh-sonpatki prathamesh-sonpatki removed their assignment Aug 19, 2017
y-yagi added a commit to y-yagi/rails that referenced this issue Aug 20, 2017
Originally, it hard-coded pid file path. It can not be removed when customizing
pid file path.
But rake task can not get pid file path. Therefore, do not remove file in rake
task, makes it possible to judge whether it is restart from the argument of the
command and removes the file in server command.

Fixes rails#29306
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants