Skip to content
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

Retry connection errors when bootstrapping bifrost #1025

Merged
merged 1 commit into from
Nov 29, 2016

Conversation

ryancragun
Copy link
Contributor

When bootstrapping new Chef Servers we've found a race condition where
the bifrost bootstrap is attempted before the service is avilable. This
change retries the ECONNREFUSED error that is raised when this occurs.

Recipe: private-chef::bootstrap
  * execute[/opt/opscode/bin/chef-server-ctl start postgresql] action run
    - execute /opt/opscode/bin/chef-server-ctl start postgresql
  * execute[/opt/opscode/bin/chef-server-ctl start oc_bifrost] action run
    - execute /opt/opscode/bin/chef-server-ctl start oc_bifrost
  * ruby_block[bootstrap-chef-server-data] action run[2016-11-29T18:34:09+00:00] WARN: Error from bifrost: Connection refused - connect(2) for "127.0.0.1" port 946
3, retrying after 1s. Retries remaining: 4

    - execute the ruby block bootstrap-chef-server-data
  * file[/var/opt/opscode/bootstrapped] action create
    - create new file /var/opt/opscode/bootstrapped
    - update content in file /var/opt/opscode/bootstrapped from none to 66e3eb
    --- /var/opt/opscode/bootstrapped   2016-11-29 18:34:10.497090364 +0000
    +++ /var/opt/opscode/.chef-bootstrapped20161129-4253-tqdg75 2016-11-29 18:34:10.497090364 +0000
    @@ -1 +1,2 @@
    +bootstrapped on 2016-11-29T18:33:41+00:00 (you punk)
    - change mode from '' to '0600'
    - change owner from '' to 'root'
    - change group from '' to 'root'

When bootstrapping new Chef Servers we've found a race condition where
the bifrost bootstrap is attempted before the service is avilable. This
change retries the ECONNREFUSED error that is raised when this occurs.

Signed-off-by: Ryan Cragun <[email protected]>
@ryancragun ryancragun force-pushed the ryan/bifrost-bootstrap branch from 5e75833 to 865a0b7 Compare November 29, 2016 18:44
@sdelano
Copy link
Contributor

sdelano commented Nov 29, 2016

👍 LGTM

Copy link
Contributor

@stevendanna stevendanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ryancragun ryancragun merged commit ae8b3bd into master Nov 29, 2016
@ryancragun ryancragun deleted the ryan/bifrost-bootstrap branch November 29, 2016 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants