Skip to content

Comments

fix(distributed): execute work units and track task outcomes#795

Open
adolago wants to merge 1 commit intomainfrom
issue-787-distributed-execution
Open

fix(distributed): execute work units and track task outcomes#795
adolago wants to merge 1 commit intomainfrom
issue-787-distributed-execution

Conversation

@adolago
Copy link
Owner

@adolago adolago commented Feb 23, 2026

Summary

  • implement real work-unit task execution in Controller::execute_work_unit
  • execute supported task modules (command, shell) using task module + args
  • persist per-task results (stdout/stderr/exit code), errors, and final work-unit state
  • mark work units Failed on task failures instead of placeholder completion
  • add regression tests for non-placeholder completion behavior and failure-state tracking

Closes #787

Test evidence

  • cargo test --features distributed distributed::controller::tests -- --nocapture
  • Result: 4 passed; 0 failed
  • Covered tests:
    • test_controller_creation
    • test_controller_info
    • test_execute_work_unit_not_completed_when_task_cannot_execute
    • test_execute_work_unit_marks_failed_on_task_failure

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ee6ed250eb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +237 to +238
for (task_index, task) in tasks.into_iter().enumerate() {
let task_result = self.execute_task(&task).await;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor when conditions before running tasks

execute_work_unit now executes every task in order without checking TaskSpec.when, so any conditional task is run unconditionally. In workflows that submit work units with when expressions (for example, guard tasks that should be skipped on certain hosts/variables), this can trigger unintended commands and false failures instead of a skip, which changes playbook semantics and can produce incorrect side effects.

Useful? React with 👍 / 👎.

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.

Distributed controller marks work units completed without executing tasks

1 participant