Execute resource retries


#1

Hello List,

The package manager from node has a little race condition problem that I think I should be able to solve with the “Common Functionality” of a retry, but setting this value appears to have no effect (but strangely enough, setting the delay works)… see run fragment below:

In /var/chef/cache/cookbooks/thumbnail/recipes/default.rb

79: execute ‘install-npm-pkgs’ do
80: retries 3
81: retry_delay 4
82: command ‘npm install’
83: cwd node[’service’][‘code_directory’]
86: end
87: end

Compiled Resource:

Declared in /var/chef/cache/cookbooks/thumbnail/recipes/default.rb:79:in `from_file’

execute(“install-npm-pkgs”) do
action "run"
retries 0
retry_delay 4
guard_interpreter :default
command "npm install"
backup 5
cwd "/var/www/thumbnail/current"
group "devops"
returns 0
user "devops"
cookbook_name "thumbnail"
recipe_name "default"
end

TIA, Michael


#2

found my solution, it’s fixed in 12, nvrmnd: https://github.com/opscode/chef/issues/2258 https://github.com/opscode/chef/issues/2258

On Dec 4, 2014, at 6:28 PM, Michael Lindsay mlindsay@metrodigi.com wrote:

Hello List,

The package manager from node has a little race condition problem that I think I should be able to solve with the “Common Functionality” of a retry, but setting this value appears to have no effect (but strangely enough, setting the delay works)… see run fragment below:

In /var/chef/cache/cookbooks/thumbnail/recipes/default.rb

79: execute ‘install-npm-pkgs’ do
80: retries 3
81: retry_delay 4
82: command ‘npm install’
83: cwd node[’service’][‘code_directory’]
86: end
87: end

Compiled Resource:

Declared in /var/chef/cache/cookbooks/thumbnail/recipes/default.rb:79:in `from_file’

execute(“install-npm-pkgs”) do
action "run"
retries 0
retry_delay 4
guard_interpreter :default
command "npm install"
backup 5
cwd "/var/www/thumbnail/current"
group "devops"
returns 0
user "devops"
cookbook_name "thumbnail"
recipe_name "default"
end

TIA, Michael