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

Changed default bundle_path from a relative path to absolute. #71

Closed
wants to merge 1 commit into from

Conversation

pjungwir
Copy link

Because Capistrano cleans up old releases,
the default bundle_path ('vendor/bundle') causes problems with
long-running tasks, e.g. unicorn.

In unicorn the master process spawns new child processes to reload the
application, typically as part of a new cap foo deploy.
To do this it has to find the unicorn binary again.
The problem is that if you initially start the unicorn master process
with a cwd of /var/www/foo/releases/12345
plus a bundle_path of vendor/bundle,
then the path to the unicorn binary won't exist a few deploys later,
and unicorn will fail to start new workers.
But with a cwd of /var/www/foo/releases/12345
plus a bundle_path of /var/www/foo/shared/vendor/bundle,
the unicorn binary's path is all permanent elements,
so reloading will work indefinitely.

Because Capistrano cleans up old releases,
the default `bundle_path` (`'vendor/bundle'`) causes problems with
long-running tasks, e.g. unicorn.

In unicorn the master process spawns new child processes to reload the
application, typically as part of a new `cap foo deploy`.
To do this it has to find the `unicorn` binary again.
The problem is that if you initially start the unicorn master process
with a cwd of `/var/www/foo/releases/12345`
plus a `bundle_path` of `vendor/bundle`,
then the path to the `unicorn` binary won't exist a few deploys later,
and unicorn will fail to start new workers.
But with a cwd of `/var/www/foo/releases/12345`
plus a `bundle_path` of `/var/www/foo/shared/vendor/bundle`,
the `unicorn` binary's path is all permanent elements,
so reloading will work indefinitely.
@pjungwir
Copy link
Author

I noticed this problem was recently introduced here:

9414388

A second problem with that commit is that it puts "vendor/bundle" into linked_dirs even if the user asks for a different bundle_path. Maybe that should only happen automatically if the user accepts the default bundle_path? If you agree I'm happy to make another PR for it.

@kirs kirs closed this in 6b23e52 Jun 24, 2015
@kirs
Copy link
Member

kirs commented Jun 24, 2015

Thanks for catching such a elusive bug.
I fixed that by reverting the commit that caused it.

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

Successfully merging this pull request may close these issues.

2 participants