capistrano-bundle_rsync
capistrano-bundle_rsync copied to clipboard
Avoid raising file not found error in case of parallel deployment
maybe fine, https://github.com/sonots/capistrano-bundle_rsync/commit/7630f6f3c0ede880b186b519d30217f6ca4ce833.
But, I am not sure why you get error here. Do you run bundle_rsync:bundler:install
in parallel?
maybe fine, 7630f6f.
But, I am not sure why you get error here. Do you run
bundle_rsync:bundler:install
in parallel?
Yes, actually i have used aws spot instances and when more than one spot instance comes up at the same time, this code raise error.
It still looks that running “bundle_rsync:bundler:install” on local once (not parallel) is enough.
You should be able to reuse commonly installed gems on local for all your spot servers.
Following is a brief description how things are going on in my case.
- There is a bastion server from where capistrano is being triggered.
- Multiple spot instances, which comes up randomly.
Now, when a spot instance comes up, it requests the bastion server to trigger capistrano through a script using curl. This capistrano deploy task call bundle_rsync:bundler:install
and rsync gems folder from bastion server to spot server. This process take some time(around 19-20 seconds). Within this time range if another spot server comes up and request bastion to deploy, second deploy task also call bundle_rsync:bundler:install
. Now when first bundle install ends, it removes config file, and second one raise the error.
Understand, how you use.
But, in that case, I believe that capistrano-bundle_rsync is not multi-process safe even if this PR is merged.
The second cap may do bundle install
during the first cap is rsyncing. I feel inserting flock
is required somewhere a lot to achieve multi-process safety.
Let me close once.