Skip to content
Merged
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
17 changes: 12 additions & 5 deletions binaries/coordinator/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,9 @@ impl RunningDataflow {
node_stopped_at: BTreeMap::new(),
network_metrics: None,
spawn_result: CachedResult::Cached {
result: Ok(ControlRequestReply::DataflowSpawned { uuid: record.uuid }),
result: Box::new(Ok(ControlRequestReply::DataflowSpawned {
uuid: record.uuid,
})),
},
stop_reply_senders: Vec::new(),
buffered_log_messages: Vec::new(),
Expand Down Expand Up @@ -541,8 +543,11 @@ pub(crate) enum CachedResult {
Pending {
result_senders: Vec<oneshot::Sender<eyre::Result<ControlRequestReply>>>,
},
// Boxed because `ControlRequestReply` is large: without the box the
// `Cached` variant dwarfs `Pending`, which trips clippy's
// `large_enum_variant` on some targets (e.g. Windows) but not others (#2979).
Cached {
result: eyre::Result<ControlRequestReply>,
result: Box<eyre::Result<ControlRequestReply>>,
},
}

Expand Down Expand Up @@ -573,7 +578,9 @@ impl CachedResult {
for sender in result_senders.drain(..) {
Self::send_result_to(&result, sender);
}
*self = CachedResult::Cached { result };
*self = CachedResult::Cached {
result: Box::new(result),
};
}
CachedResult::Cached { .. } => {}
}
Expand All @@ -592,7 +599,7 @@ impl CachedResult {
/// the spawn-timeout watchdog (or any other terminal-failure path)
/// has already marked as failed.
pub(crate) fn is_terminal_error(&self) -> bool {
matches!(self, CachedResult::Cached { result: Err(_) })
matches!(self, CachedResult::Cached { result } if result.is_err())
}

/// Returns `true` if a successful result has been cached, i.e. the dataflow
Expand All @@ -601,7 +608,7 @@ impl CachedResult {
/// that are past spawn — spawn-pending ones remain the spawn-timeout
/// watchdog's domain. See #2028.
pub(crate) fn is_cached_ok(&self) -> bool {
matches!(self, CachedResult::Cached { result: Ok(_) })
matches!(self, CachedResult::Cached { result } if result.is_ok())
}

fn send_result_to(
Expand Down