jdx/mise · error

Infinitive loop detected, all tasks are finished but the…

Error message

Infinitive loop detected, all tasks are finished but the graph isn't empty {0} {1:#?}

What it means

Internal invariant failure in the task dependency scheduler (emit_leaves): the graph reports non-empty (self.is_empty() is false) yet no leaves remain to schedule, so the stream would never terminate. It fires when the dependency graph is inconsistent — typically a cycle introduced by remove/remove_batch, or a task whose dependents were miscounted during batch removal.

Solutions

  1. Inspect the {1:#?} graph dump in the message for a dependency cycle or orphaned tasks
  2. Fix task removal so removing a batch correctly decrements all dependents' counts
  3. Add cycle detection when building the task graph to reject recursive depends_on
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/task/deps.rs:383 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/86f3b205c90f8d60. Report an issue: GitHub.

Appendix: source

Thrown at src/task/deps.rs:383

        for task in leaves {
            let key = task_key(&task);

            if self.sent.insert(key.clone()) {
                trace!("Scheduling task {0}", task.name);
                if let Err(e) = self.tx.send(Some(task)) {
                    trace!("Error sending task: {e:?}");
                    self.sent.remove(&key);
                }
            }
        }

        if self.is_empty() {
            trace!("All tasks finished");
            if let Err(e) = self.tx.send(None) {
                trace!("Error closing task stream: {e:?}");
            }
        } else if leaves_is_empty && self.sent.len() == self.removed.len() {
            panic!(
                "Infinitive loop detected, all tasks are finished but the graph isn't empty {0} {1:#?}",
                self.all().map(|t| t.name.clone()).join(", "),
                self.graph
            )
        }
    }

    /// listened to by `mise run` which gets a stream of tasks to run
    pub(crate) fn subscribe(&mut self) -> mpsc::UnboundedReceiver<Option<Task>> {
        let (tx, rx) = mpsc::unbounded_channel();
        self.tx = tx;
        self.emit_leaves();
        rx
    }

    pub(crate) fn is_empty(&self) -> bool {
        self.graph.node_count() == 0
    }

View on GitHub (pinned to afd2eddd3a)