Skip to content

Commit

Permalink
fix(hydroflow): fix scheduler spinning on replay, fix hydro-project#961
Browse files Browse the repository at this point in the history
  • Loading branch information
MingweiSamuel committed Apr 23, 2024
1 parent 997d90a commit a8a5625
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions hydroflow_lang/src/graph/flat_to_partitioned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,11 @@ fn find_subgraph_strata(
let dst_stratum = partitioned_graph.subgraph_stratum(dst_sg);
match delay_type {
DelayType::Tick | DelayType::TickLazy => {
// If tick edge goes forward in stratum, need to buffer.
let is_lazy = matches!(delay_type, DelayType::TickLazy);
// If tick edge goes foreward in stratum, need to buffer.
// (TODO(mingwei): could use a different kind of handoff.)
if src_stratum <= dst_stratum {
// Or if lazy, need to create extra subgraph to mark as lazy.
if src_stratum <= dst_stratum || is_lazy {
// We inject a new subgraph between the src/dst which runs as the last stratum
// of the tick and therefore delays the data until the next tick.

Expand Down Expand Up @@ -445,10 +447,7 @@ fn find_subgraph_strata(
partitioned_graph.set_subgraph_stratum(new_subgraph_id, extra_stratum);

// Assign laziness.
partitioned_graph.set_subgraph_laziness(
new_subgraph_id,
matches!(delay_type, DelayType::TickLazy),
);
partitioned_graph.set_subgraph_laziness(new_subgraph_id, is_lazy);
}
}
DelayType::Stratum => {
Expand Down

0 comments on commit a8a5625

Please sign in to comment.