This repository was archived by the owner on Jun 16, 2026. It is now read-only.
fix: correct syntax errors and type mismatches in progress watching API - #117
Merged
Adam Poulemanos (bashandbone) merged 2 commits intoMar 19, 2026
Merged
Adam Poulemanos (bashandbone) merged 2 commits into
Adam Poulemanos (bashandbone) merged 2 commits into
Conversation
… stats/live_updater Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot
AI
changed the title
[WIP] Add progress watching API with per-component tracking
fix: correct syntax errors and type mismatches in progress watching API
Mar 19, 2026
Adam Poulemanos (bashandbone)
marked this pull request as ready for review
March 19, 2026 16:21
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes compilation-blocking issues in the progress watching implementation so flow progress updates and per-component stats compile and behave correctly.
Changes:
- Move
UpdateStats::{component_start,component_complete,component_error}back into the correctimpl UpdateStatsblock and consolidate duplicatetestsmodules. - Fix stats tests to use the correct
ProcessingCountersAPI and correct the in-process accounting assertion. - Correct
FlowLiveUpdaterprogress emission by properly awaitingtokio::sync::Mutex::lock(), cloning thewatch::Receiverfromrecv_state, and mapping active source indices to names safely.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/recoco-core/src/execution/stats.rs | Restores correct UpdateStats impl structure and fixes/relocates component stats tests. |
| crates/recoco-core/src/execution/live_updater.rs | Fixes async mutex usage and corrects active source tracking/name mapping for progress updates. |
Comments suppressed due to low confidence (1)
crates/recoco-core/src/execution/live_updater.rs:598
emit_progress_updatekeeps thetokio::sync::Mutex<UpdateReceiveState>guard while building and sending theProgressUpdate. Even though this is small work today, it can block concurrent callers ofnext_status_updates()longer than necessary. Consider cloning only the needed status fields inside a short lock scope (or makeFlowLiveUpdaterStatus: Cloneand clone it), then drop the guard before assembling/sending the update.
async fn emit_progress_update(&self) {
// Always wait for the recv_state lock so we don't silently drop updates,
// especially the final completion snapshot.
let recv_state = self.recv_state.lock().await;
let status = recv_state.status_rx.borrow();
let active_sources: Vec<String> = status
.active_source_idx
.iter()
.filter_map(|&idx| {
self.flow_ctx
.flow
.flow_instance
.import_ops
.get(idx)
.map(|op| op.name.clone())
})
.collect();
let total_sources = self.stats_per_task.len();
let completed_sources = total_sources - status.active_source_idx.len();
let source_stats: Vec<stats::SourceUpdateInfo> = std::iter::zip(
self.flow_ctx.flow.flow_instance.import_ops.iter(),
self.stats_per_task.iter(),
)
.map(|(import_op, stats)| stats::SourceUpdateInfo {
source_name: import_op.name.clone(),
stats: stats.as_ref().clone(),
})
.collect();
let operation_in_process = self
.operation_in_process_stats
.get_all_operations_in_process();
let update = ProgressUpdate {
active_sources,
total_sources,
completed_sources,
source_stats,
operation_in_process,
};
let _ = self.progress_tx.send(Some(update));
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adam Poulemanos (bashandbone)
merged commit Mar 19, 2026
007d161
into
claude/issue-99-20260316-1711
11 of 12 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The progress watching implementation introduced in the previous commits had multiple compilation-blocking errors: orphaned methods outside
implblocks, duplicatemod tests, and incorrect usage oftokio::sync::Mutexas if it werestd::sync::Mutex.Stats (
execution/stats.rs)component_start/component_complete/component_errorwere placed after the#[cfg(test)] mod testsclosing brace instead of insideimpl UpdateStats— moved into the correct#[cfg(feature = "persistence")]impl block#[cfg(test)] mod testsblocks merged into oneprocessing.inc()/processing.get()which don't exist onProcessingCounters— corrected toprocessing.start(),processing.num_starts.get(),processing.get_in_process()component_counters_update_correctlycreated 3 endings for 2 starts (producingin_process = -1) — fixed by starting 3 itemsLive Updater (
execution/live_updater.rs)emit_progress_updateusedmatch self.recv_state.lock() { Ok(s) => s, Err(p) => p.into_inner() }—tokio::sync::Mutex::lock()returns a future, not aResult. Changed toasync fnusing.awaitwait()referencedself.status_rx(doesn't exist as a direct field; lives insiderecv_state) — now locksrecv_statebriefly to clone the receiver before spawning the emitter taskstatus_rx.borrow().active_sources→active_source_idx, with indices mapped to source names via bounds-safe.filter_map/.get()✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.