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
25 changes: 6 additions & 19 deletions lib/syskit/network_generation/runtime_network_adaptation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,12 @@ def apply
result
end

def interruption_point(name, log_on_interruption_only: false)
continue = @resolution_control.interruption_point(
self, name, log_on_interruption_only: log_on_interruption_only
)
throw :syskit_netgen_cancelled unless continue
end

# Given the network with deployed tasks, this method looks at how we
# could adapt the running network to the new one
def finalize_deployed_tasks
finishing_deployments, existing_deployments =
import_from_runtime_plan
interruption_point "syskit-netgen:apply:import-from-runtime-plan"
log_timepoint "syskit-netgen:apply:import-from-runtime-plan"

used_deployments_with_existing =
used_deployments_find_existing(
Expand Down Expand Up @@ -92,7 +85,7 @@ def import_from_runtime_plan
used_tasks = @work_plan.find_local_tasks(Component).to_set

all_tasks = import_existing_tasks
interruption_point "syskit-netgen:apply:imported-existing-tasks"
log_timepoint "syskit-netgen:apply:imported-existing-tasks"
imported_tasks_remove_direct_connections(all_tasks - used_tasks)

finishing_deployments, existing_deployments =
Expand Down Expand Up @@ -138,10 +131,7 @@ def finalize_used_deployments(used_deployments_with_existing)
newly_deployed_tasks.merge(new)
reused_deployed_tasks.merge(reused)
selected_deployment_tasks << selected
interruption_point(
"syskit-netgen:apply:select-deployment",
log_on_interruption_only: true
)
log_timepoint "syskit-netgen:apply:select-deployment"
end
log_timepoint "syskit-netgen:selected-deployments"

Expand Down Expand Up @@ -297,7 +287,7 @@ def existing_deployment_needs_restart?(required, existing)
# new network
def import_existing_tasks
all_tasks = @work_plan.find_tasks(Component).to_set
interruption_point "syskit-engine:imported-tasks"
log_timepoint "syskit-engine:imported-tasks"

all_tasks.delete_if do |t|
if t.finished?
Expand All @@ -310,7 +300,7 @@ def import_existing_tasks
true
end
end
interruption_point "syskit-engine:imported-tasks:cleanup"
log_timepoint "syskit-engine:imported-tasks:cleanup"

all_tasks
end
Expand All @@ -330,10 +320,7 @@ def imported_tasks_remove_direct_connections(tasks)
dataflow_graph.set_edge_info(source_t, t, connections)
end
end
interruption_point(
"syskit-engine:imported-tasks:dataflow-cleanup",
log_on_interruption_only: true
)
log_timepoint "syskit-engine:imported-tasks:dataflow-cleanup"
end
end

Expand Down