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

Fix for a race condition where event_list is empty when process_events_until_done is called #8825

komealy opened this issue Aug 16, 2019 · 2 comments


Copy link

commented Aug 16, 2019

Describe the Enhancement:

I get an inconsistent error when running chef-zero with a very small runlist.

sh-4.2$ sudo cat /var/chef/.chef/local-mode-cache/cache/chef-stacktrace.out
Generated at 2019-08-16 15:12:23 +0000
ArgumentError: wrong number of arguments (given 0, expected 1+)
/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.2.20/lib/chef/event_dispatch/dispatcher.rb:59:in `call_subscribers'
/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.2.20/lib/chef/event_dispatch/dispatcher.rb:84:in `process_events_until_done'
/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.2.20/lib/chef/event_dispatch/dispatcher.rb:31:in `enqueue'
(eval):2:in `updated_cookbook_file'
/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.2.20/lib/chef/cookbook/synchronizer.rb:290:in `sync_file'
/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.2.20/lib/chef/cookbook/synchronizer.rb:176:in `block (2 levels) in sync_cookbooks'
/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.2.20/lib/chef/util/threaded_job_queue.rb:52:in `block (3 levels) in process'
/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.2.20/lib/chef/util/threaded_job_queue.rb:50:in `loop'
/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.2.20/lib/chef/util/threaded_job_queue.rb:50:in `block (2 levels) in process'

Describe the Need:

Anyone using chef-zero with only one cookbook. Not sure how many people that actually is, but we use that to make sure our minimal scripts are installed so retries can occur if anything fails.

Current Alternative

Re-running the chef-zero command gets past this issue.

Can We Help You Implement This?:

I have a local/forked branch with a very ruby-esque fix using a sentinel statement to return if the event list is empty when this function is called. What I would need is permission to open the PR for it.


This comment has been minimized.

Copy link

commented Sep 7, 2019

I have a cookbook with 6 suites. I hit this 20/20 times on one the suites. When I feel back to 15.1.36 and it is has passed 5/5 times.


This comment has been minimized.

Copy link

commented Sep 9, 2019

I'm with same problem trying to run chef client. When I run the second time it passed:

Chef Infra Client, version 15.2.20

ArgumentError: wrong number of arguments (given 0, expected 1+)
C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.2.20-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:59:in `call_subscribers'
C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.2.20-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:84:in `process_events_until_done'
C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.2.20-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:31:in `enqueue'
(eval):2:in `updated_cookbook_file'
C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.2.20-universal-mingw32/lib/chef/cookbook/synchronizer.rb:290:in `sync_file'
C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.2.20-universal-mingw32/lib/chef/cookbook/synchronizer.rb:176:in `block (2 levels) in sync_cookbooks'
C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.2.20-universal-mingw32/lib/chef/util/threaded_job_queue.rb:52:in `block (3 levels) in process'
C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.2.20-universal-mingw32/lib/chef/util/threaded_job_queue.rb:50:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.2.20-universal-mingw32/lib/chef/util/threaded_job_queue.rb:50:in `block (2 levels) in process'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
5 participants
You can’t perform that action at this time.