Skip to content
Open
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
36 changes: 22 additions & 14 deletions lib/syskit/network_generation/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ def compute_deployed_network(
compute_policies: true,
early_deploy: Syskit.conf.early_deploy?,
lazy_deploy: Syskit.conf.lazy_deploy?,
validate_deployed_network: true
validate_deployed_network: true,
cleanup_resolution_errors: true
)
resolution_errors = []
log_timepoint_group "syskit-netgen:deploy-system-network" do
Expand All @@ -133,16 +134,20 @@ def compute_deployed_network(
lazy: lazy_deploy
)
resolution_errors = process_failures(
error_handler, required_instances, cleanup_failed_tasks: true
)
# Sanity check that the plan was properly cleaned up
SystemNetworkDeployer.verify_all_tasks_deployed(
work_plan, default_deployment_group, lazy: lazy_deploy
)
SystemNetworkGenerator.verify_all_deployments_are_unique(
work_plan, toplevel_tasks_to_requirements.dup,
early_deploy: early_deploy
error_handler, required_instances,
cleanup_resolution_errors: cleanup_resolution_errors
)

if cleanup_resolution_errors
# Sanity check that the plan was properly cleaned up
SystemNetworkDeployer.verify_all_tasks_deployed(
work_plan, default_deployment_group, lazy: lazy_deploy
)
SystemNetworkGenerator.verify_all_deployments_are_unique(
work_plan, toplevel_tasks_to_requirements.dup,
early_deploy: early_deploy
)
end
end

interruption_point(
Expand Down Expand Up @@ -409,7 +414,7 @@ def compute_system_network(
resolution_errors = process_failures(
error_handler,
required_instances,
cleanup_failed_tasks: cleanup_resolution_errors
cleanup_resolution_errors: cleanup_resolution_errors
)
if cleanup_resolution_errors
# Sanity check that the plan was properly cleaned up
Expand All @@ -424,9 +429,11 @@ def compute_system_network(
[required_instances, resolution_errors, toplevel_tasks_to_requirements]
end

def process_failures(error_handler, required_instances, cleanup_failed_tasks:)
def process_failures(
error_handler, required_instances, cleanup_resolution_errors:
)
resolution_errors = error_handler.process_failures(required_instances)
return resolution_errors unless cleanup_failed_tasks
return resolution_errors unless cleanup_resolution_errors

error_handler.cleanup_resolution_errors(
resolution_errors, required_instances, work_plan
Expand Down Expand Up @@ -503,7 +510,8 @@ def resolve_system_network(
compute_policies: compute_policies,
early_deploy: early_deploy,
lazy_deploy: lazy_deploy,
validate_deployed_network: validate_deployed_network
validate_deployed_network: validate_deployed_network,
cleanup_resolution_errors: cleanup_resolution_errors
)
resolution_errors.concat(deployment_resolution_errors)
end
Expand Down