Atalanta / cucumber-chef

Framework for test-driven infrastructure development
http://cucumber-chef.org
Apache License 2.0
265 stars 55 forks source link

data bag syncing #90

Closed zpatten closed 11 years ago

zpatten commented 11 years ago

Data bags do not always update immediately. Working on a fix to block until the update happens before returning.

zpatten commented 11 years ago

The issue here appears to have been related to solr caching and commit strategies. Besides caching being enabled by default; the thresholds to commit the data, by default, is at 100 document changes or 10000 msec since the last change. Since with cucumber-chef, a cuke will likely update a data bag and then immediately trigger a chef-client run; the data bag was frequently queried before the 10 second time period passed and definitely before 99 other document changes had occurred. This frequently resulted in incorrect data bag contents being returned to the chef-client.

To make matters worse; when attempting to loop and re-read the data bag after updating it, the chef-server API is always returning the correct data bag raw_data even thou seconds later the chef-client would receive the wrong data.

I did not investigate this last piece fully (I'm gonna guess it was a result of the solr caching) as disabling the cache and modifying the thresholds down to 1 document change or 1 msec since the last change to commit appears to have resolved the issue.

zpatten commented 11 years ago

I am going to leave this open for now in case anyone has data bag issues; report them here for now please.

zpatten commented 11 years ago

Fixed in >= 2.1.0