[chef] Re: Re: Sorting bug?


Chronological Thread 
  • From: "Jason J. W. Williams" < >
  • To:
  • Subject: [chef] Re: Re: Sorting bug?
  • Date: Wed, 7 Nov 2012 19:25:39 -0800

They may not preserve ordering when adding/removing items are involved, but absent anything changing in the hash, we haven't seen them change. These cookbooks have been running for months with no problem (and continuing with no problem on the other nodes).

-J

On Wed, Nov 7, 2012 at 7:20 PM, AJ Christensen < " target="_blank"> > wrote:
Hashes don't preserve ordering in Ruby 1.8.7

I'd suggest installing and using Chef with the Omnibus Installers, this will give you a modern Ruby environment (1.9.3-p194 or similar)

Cheers,

AJ


On 8 November 2012 16:03, Jason J. W. Williams < " target="_blank"> > wrote:
So we set up a new Chef client (10.16.2) from scratch  and we've noticed some interesting behavior:

Any cookbook that relies on iteration over a list of any sort now returns random ordering of the list between runs with no change in the underlying data.

For example the following data:

default[:testapp][:languages] = {"US" => "ASCII",
                                               "JP" => "utf-8"}

When inserted into a file with this template code:
[Languages]
<% for language in node[:testapp][:languages].keys-%>
<%=language%>:<%=node[:testappanguages][language]%>
<% end-%>

Sometimes generates:

[Languages]
JP:utf-8
US:ASCII

And other times generates:

[Languages]
US:ASCII
JP:utf-8


Again nothing has changed between runs in the underlying data, cookbooks or roles. This doesn't affect any of our existing nodes (we noticed it but multiple apps on the new node were intermittently and restarting for no reason). Also downgrading the affected node to Chef 0.10.8 or 10.14.2 (the versions we run on the other nodes) doesn't help.

Ruby version is 1.8.7 across the board. Unaffected nodes are running Ubuntu 10.04.3 LTS, the affected node is running 10.04.4 LTS.

Any ideas what may be causing this?

-J








Archive powered by MHonArc 2.6.16.

§