Skip to content

Dispatch TaskStart event when execution loop dequeues task#6893

Draft
samstokes wants to merge 1 commit into
mainfrom
claude/fix-flotilla-taskstart-event-YkGJo
Draft

Dispatch TaskStart event when execution loop dequeues task#6893
samstokes wants to merge 1 commit into
mainfrom
claude/fix-flotilla-taskstart-event-YkGJo

Conversation

@samstokes
Copy link
Copy Markdown
Collaborator

Changes Made

Refactored the timing of TaskStart event dispatch to occur when the execution loop actually begins processing a task, rather than when the task is enqueued to the channel.

Implementation Details

  • Created a new TaskStartDispatch struct to carry both the event and subscribers together
  • Added an on_dequeue field to EnqueueInputMessage to transport the dispatch information through the channel
  • Moved event dispatch from the enqueue call site to inside run_execution_loop, immediately before the task's inputs are pushed into the running pipeline
  • This ensures the event fires at the moment the task truly begins executing, not just when it was accepted onto the per-plan enqueue channel

This change provides more accurate timing for task execution monitoring and event-driven systems that depend on knowing when a task actually starts running.

Related Issues

https://claude.ai/code/session_01QJ9jBxiSq9dPc1kdJHmr46

TaskStart previously fired immediately after the per-plan enqueue
channel accepted the message — i.e., when the worker accepted the task
for execution, not when execution actually started. Move the dispatch
into run_execution_loop so it fires when the message is dequeued and
the task's inputs are about to be pushed into the running pipeline.

The dispatch (event + subscribers) is carried on EnqueueInputMessage,
so this works for every LocalSwordfishTask without touching individual
task types.

https://claude.ai/code/session_01QJ9jBxiSq9dPc1kdJHmr46
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Rust Dependency Diff

Head: bd7918081077438768d4a255277f61ade1e7070d vs Base: 8b81448056c53eac27052fb25af75089f3f612f2.

OK: Within budget.

  • New Crates: 0
  • Removed Crates: 0

@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

❌ Patch coverage is 44.44444% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.38%. Comparing base (8b81448) to head (7f3ac4e).

Files with missing lines Patch % Lines
src/daft-local-execution/src/run.rs 44.44% 5 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6893      +/-   ##
==========================================
+ Coverage   75.34%   75.38%   +0.04%     
==========================================
  Files        1135     1135              
  Lines      160433   160430       -3     
==========================================
+ Hits       120881   120948      +67     
+ Misses      39552    39482      -70     
Files with missing lines Coverage Δ
src/daft-local-execution/src/run.rs 74.11% <44.44%> (+0.05%) ⬆️

... and 17 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants