-
-
Notifications
You must be signed in to change notification settings - Fork 180
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
iis_pool is not idempotent when recycle_at_time is specified and is not changed #279
Comments
I'll look into this in around 9 hours, sounds like the check is broken. Justin Schuhmann
|
Status: Spinning up test environment |
Cookbook version
4.1.7
Chef-client version
chef-client: 12.7.2
kitchen: 1.5.0
Platform Details
Windows Server 2012 R2
Issue:
After an app pool has been configured with iis_pool resource parameter recycle_at_time the next time the cookbook converges (with no changes to the app pool) the app pool is restarted.
Steps to Reproduce:
Example:
Expected Result:
The second cookbook converge should be, effectively, a noop. It shouldn't adjust the app pool or cause the app pool to restart. The cook book (and more specifically the iis_pool resource) should be idempotent.
Actual Result:
Each time the cookbook converges the app pool is restarted. This can be observed in a few ways.
First the output from test kitchen reports the app pool is being configured:
[2016-06-14T17:36:26-05:00] INFO: iis_pool[foo] configured application pool
Web Server IIS
event log will report that the app pool was restarted (because of a configuration change).Further investigation notes
I spent several hours scratching my head over this and reading the IIS cookbook code. After careful inspection I believe the bug is probably happening here (my best guess):
iis/providers/pool.rb: lines 238-239:
I believe the problematic OR check is this statement:
(new_resource.recycle_at_time && is_new_recycle_at_time) || !node_array.empty?
. If I'm reading that correctly, in the context of the above, it will result inshould_clear_apppool_schedules == true
if we had a recycle_at_time but that recycle_at_time was not a new time. Meaning the app_pool was already configured with a restart time - so the node_array was not empty. But the restart time was also not new.When I run the kitchen converge with debug output - it seems to agree that this is happening. Here is roughly what I see:
On Feb 17th it appears the above code was updated: b5b95db
Looking at the
4.1.7
release notes - I am guessing this was changed due to this bug: #247The bug suggests there needs to be a way to reset the recycle_at_time to default. From reading the original code above - it seems that could have been accomplished by providing the recycle_schedule_clear attribute with a value of true. If any schedule items existed it should have cleared them (and put the app pool back into the default / no schedule state).
In any case the current fix appears to have a side effect that's impacting idempotency.
The text was updated successfully, but these errors were encountered: