{"action":"created","issue":{"url":"https://api.github.com/repos/bloomberg/chef-bcpc/issues/590","labels_url":"https://api.github.com/repos/bloomberg/chef-bcpc/issues/590/labels{/name}","comments_url":"https://api.github.com/repos/bloomberg/chef-bcpc/issues/590/comments","events_url":"https://api.github.com/repos/bloomberg/chef-bcpc/issues/590/events","html_url":"https://github.com/bloomberg/chef-bcpc/issues/590","id":78525769,"number":590,"title":"Fix occasional reshuffling of RabbitMQ servers on Chef runs","user":{"login":"erhudy","id":1065271,"avatar_url":"https://avatars.githubusercontent.com/u/1065271?v=3","gravatar_id":"","url":"https://api.github.com/users/erhudy","html_url":"https://github.com/erhudy","followers_url":"https://api.github.com/users/erhudy/followers","following_url":"https://api.github.com/users/erhudy/following{/other_user}","gists_url":"https://api.github.com/users/erhudy/gists{/gist_id}","starred_url":"https://api.github.com/users/erhudy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erhudy/subscriptions","organizations_url":"https://api.github.com/users/erhudy/orgs","repos_url":"https://api.github.com/users/erhudy/repos","events_url":"https://api.github.com/users/erhudy/events{/privacy}","received_events_url":"https://api.github.com/users/erhudy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-20T13:25:26Z","updated_at":"2015-05-20T13:27:43Z","closed_at":null,"body":"As part of the upgrade to Kilo, I removed RabbitMQ from HAProxy and reconfigured everything in OpenStack that uses RabbitMQ to use a list of servers. OpenStack is a bit unintelligent and just piles on the first server in the list, which isn't ideal.\r\n\r\nTo combat this, I configured the server list in the template to be shuffled by a PRNG seeded with the IP address of the server as the seed in order to make the results of the shuffling deterministic (`@rabbit_hosts_shuffle_rng` is passed in from the recipe):\r\n```\r\n@servers.map{|x| x['bcpc']['management']['ip'] + \":5672\"}.shuffle(random: @rabbit_hosts_shuffle_rng).join(',')\r\n```\r\nThis isn't working as intended and sometimes the list gets reshuffled in the different templates (not always, and I'm not certain if it gets reshuffled for every template simultaneously on the occasions where the reshuffle happens)."},"comment":{"url":"https://api.github.com/repos/bloomberg/chef-bcpc/issues/comments/103888782","html_url":"https://github.com/bloomberg/chef-bcpc/issues/590#issuecomment-103888782","issue_url":"https://api.github.com/repos/bloomberg/chef-bcpc/issues/590","id":103888782,"user":{"login":"erhudy","id":1065271,"avatar_url":"https://avatars.githubusercontent.com/u/1065271?v=3","gravatar_id":"","url":"https://api.github.com/users/erhudy","html_url":"https://github.com/erhudy","followers_url":"https://api.github.com/users/erhudy/followers","following_url":"https://api.github.com/users/erhudy/following{/other_user}","gists_url":"https://api.github.com/users/erhudy/gists{/gist_id}","starred_url":"https://api.github.com/users/erhudy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erhudy/subscriptions","organizations_url":"https://api.github.com/users/erhudy/orgs","repos_url":"https://api.github.com/users/erhudy/repos","events_url":"https://api.github.com/users/erhudy/events{/privacy}","received_events_url":"https://api.github.com/users/erhudy/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T13:27:43Z","updated_at":"2015-05-20T13:27:43Z","body":"First attempt to fix will be to move that logic out of the template and into a function in `utils.rb`. I am suspicious that multiple resources using the PRNG may be influencing one another, even though it's supposed to be a new PRNG each time with the same seed, and so the first draw should always be the same."}}