8000 [BUG] Invalid job dependencies execute tasks or report successful cycles · Issue #40 · dmux/minilake · GitHub
[go: up one dir, main page]

Skip to content

[BUG] Invalid job dependencies execute tasks or report successful cycles #40

Closed

Description

@eddiethedean

Description

Unknown dependency keys are silently removed, allowing dependent tasks to execute without their prerequisites. Cycles skip every involved task yet mark the run SUCCESS.

Reproduced on MiniLake 1.9.0, commit fe8837dcfac9df621dfabc440abc07ebb4cdbcbb, using the repository's Docker test image, a real HTTP server, and fresh disposable state. Image Python sources were verified byte-for-byte against this commit. No mocks or production data were used.

Affected Components

Steps to Reproduce

Use a disposable instance and data directory. Paths below are relative to its HTTP base URL; bodies are JSON unless explicitly described as raw bytes. IDs shown as W/J/R/Q/C/HANDLE are replaced with the IDs returned by prior calls.

  1. Create a warehouse W and upload /ok.sql containing SELECT 123 via POST /api/2.0/workspace-files/import-file/ok.sql (raw body).
  2. POST /api/2.2/jobs/runs/submit with {"tasks":[{"task_key":"dependent","depends_on":[{"task_key":"missing"}],"sql_task":{"warehouse_id":"W","file":{"path":"/ok.sql"}}}]} (substitute W).
  3. Poll /api/2.2/jobs/runs/get?run_id=R: the dependent task executes and succeeds.
  4. Submit two such tasks a and b with a depending on b and b depending on a; poll again.

Expected Behavior

Reject unknown dependency references and cycles before starting any task; invalid workflows must not report success.

Actual Behavior

Unknown dependency: task and run are TERMINATED/SUCCESS. Cycle: both tasks are SKIPPED with Unresolvable dependency or cycle, but the overall run is TERMINATED/SUCCESS.

Root Cause Analysis

The dependency map filters out keys absent from task_by_key. The cycle branch only records SKIPPED; final status checks only FAILED/TIMEDOUT and therefore selects SUCCESS.

Impact

A typo can allow writes/publishing before prerequisite tasks run. CI can accept a cyclic workflow that performed no work, hiding deployment and data-pipeline failures.

Severity is assessed within MiniLake's documented local development/CI use; it does not assume a shared production Databricks deployment.

Suggested Fix

Validate unique task keys, all dependency references, and acyclicity on create/update/submit. Treat an unschedulable runtime graph as a failed run, and prevent side effects before validation completes.

Test Coverage Gaps

DAG tests cover valid chains/diamonds and run_if, but no unknown references or cycles. Add both malformed graphs and assert no task body executed.

Severity

High

Confidence

High — reproduced through the real HTTP API and traced to the source paths above.

Recommended Labels

bug, high-priority

Existing Issue Matches

No reasonable duplicate found. Reviewed all open and closed issues and open pull requests in dmux/minilake, then searched component/function/symptom terms for this finding. The only open PR at review time, #29, changes the virtualenv lock entry and does not address this defect. The documented intentional limitations were checked before reporting.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0