Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
iis_pool is not idempotent when recycle_at_time is specified and is not changed #279
Windows Server 2012 R2
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:
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.
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:
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:
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
The 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.
I'll look into this in around 9 hours, sounds like the check is broken.