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

Fixes #7086: Promise copy is not convergent: if the copy is interupte… #737

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions initial-promises/node-server/common/1.0/update.cf
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ bundle agent update_action
action => immediate,
classes => success("config", "no_update", "config_ok");

# If the file to check if update are available was updated, but the promises files failed to copy correctly, we must force a new copy of the promises at next run
rudder_promises_generated_repaired.!root_server.no_update::
"${client_inputs}/${file_to_check_update}"
delete => tidy,
comment => "Deleting ${file_to_check_update} as the policy files couldn't be downloaded";

root_server|(rudder_promises_generated_ok|(rudder_promises_generated_repaired.(config|config_ok)).!no_update.!rudder_promises_generated_error)::
# Every time we check update inputs successfully (already up to date or
# updated), touch a file to let other promises know we are doing ok
Expand All @@ -223,6 +229,12 @@ bundle agent update_action
action => immediate,
classes => success("rudder_tools_updated", "rudder_tools_update_error", "rudder_tools_updated_ok");

# If we couldn't update the tools, then we must force a copy at next run
rudder_tools_update_error::
"${g.rudder_tools_updated}"
delete => tidy,
comment => "Deleting ${g.rudder_tools_updated} as the tools couldn't be updated";

processes:
config.!windows::
"cf-serverd" restart_class => "start_server";
Expand Down Expand Up @@ -320,6 +332,9 @@ body classes success(if, else, kept)
repair_denied => { "${else}" };
repair_timeout => { "${else}" };

cancel_kept => { "${else}" };
cancel_repaired => { "${else}" };

# persist for 4 minutes so that it wont overlap with the next
# execution in 5 minutes
persist_time => "4";
Expand Down
15 changes: 15 additions & 0 deletions techniques/system/common/1.0/update.st
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ bundle agent update_action
action => immediate,
classes => success("config", "no_update", "config_ok");

# If the file to check if update are available was updated, but the promises files failed to copy correctly, we must force a new copy of the promises at next run
rudder_promises_generated_repaired.!root_server.no_update::
"${client_inputs}/${file_to_check_update}"
delete => tidy,
comment => "Deleting ${file_to_check_update} as the policy files couldn't be downloaded";

root_server|(rudder_promises_generated_ok|(rudder_promises_generated_repaired.(config|config_ok)).!no_update.!rudder_promises_generated_error)::
# Every time we check update inputs successfully (already up to date or
# updated), touch a file to let other promises know we are doing ok
Expand All @@ -223,6 +229,12 @@ bundle agent update_action
classes => success("rudder_tools_updated", "rudder_tools_update_error", "rudder_tools_updated_ok"),
comment => "Update the Rudder tools";

# If we couldn't update the tools, then we must force a copy at next run
rudder_tools_update_error::
"${g.rudder_tools_updated}"
delete => tidy,
comment => "Deleting ${g.rudder_tools_updated} as the tools couldn't be updated";

processes:
config.!windows::
"cf-serverd" restart_class => "start_server";
Expand Down Expand Up @@ -328,6 +340,9 @@ body classes success(if, else, kept)
repair_denied => { "${else}" };
repair_timeout => { "${else}" };

cancel_kept => { "${else}" };
cancel_repaired => { "${else}" };

Copy link
Member Author

Choose a reason for hiding this comment

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

this is already in branch 2.11

# persist for 4 minutes so that it wont overlap with the next
# execution in 5 minutes
persist_time => "4";
Expand Down