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

[chef-client] Enable chef-client scheduled task to behave like cron, … #739

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gholtiii
Copy link

@gholtiii gholtiii commented Jul 19, 2021

Make chef-client scheduled task behave like cron, with a predictable start time and splay that stays consistent for a given node

Description

The chef-client windows scheduled task uses a random delay that can be up to 25 minutes and a start time based on when the code actually runs. Instead this change is meant to make the start time predictable, similar to a cron entry like */30, and the splay is used to compute a distinct per node value identical to how it's being done on cron (splay_sleep_time method). This enables the next actual start time for a chef run to be predictable for a given node.

Issues Resolved

Check List

@gholtiii gholtiii force-pushed the gh/add_cron_parity_to_scheduled_task branch from de1a842 to 361b86e Compare July 19, 2021 21:19
@gholtiii gholtiii closed this Jul 19, 2021
@gholtiii gholtiii reopened this Jul 19, 2021
@gholtiii gholtiii force-pushed the gh/add_cron_parity_to_scheduled_task branch 12 times, most recently from bd7fbaf to 4cd29c2 Compare July 21, 2021 22:36
@@ -17,9 +17,10 @@
# limitations under the License.
#

chef_version_for_provides '< 16.0' if respond_to?(:chef_version_for_provides)
chef_version_for_provides '< 18.0' if respond_to?(:chef_version_for_provides)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gholtiii this was added so that the resource shipped in the core of chef infra client would be used over this resource.

https://github.com/chef/chef/blob/master/lib/chef/resource/chef_client_scheduled_task.rb

In other words, these changes should be made in https://github.com/chef/chef

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitted to the core chef/chef#11894

I'll fix this version constraint and resubmit, though it seems this cookbook should be deprecated given the above.

@gholtiii gholtiii force-pushed the gh/add_cron_parity_to_scheduled_task branch 6 times, most recently from 6ebfe1f to 7890004 Compare August 3, 2021 21:03
…with predictable splay and start time

Signed-off-by: George Holt <[email protected]>
@gholtiii gholtiii force-pushed the gh/add_cron_parity_to_scheduled_task branch from 7890004 to 87affb5 Compare August 3, 2021 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants