{"record":{"id":"86f3b205c90f8d60","repo":"jdx/mise","slug":"infinitive-loop-detected-all-tasks-are-finished-b","errorCode":null,"errorMessage":"Infinitive loop detected, all tasks are finished but the graph isn't empty {0} {1:#?}","messagePattern":"Infinitive loop detected, all tasks are finished but the graph isn't empty (.+?) (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/deps.rs","lineNumber":383,"sourceCode":"        for task in leaves {\n            let key = task_key(&task);\n\n            if self.sent.insert(key.clone()) {\n                trace!(\"Scheduling task {0}\", task.name);\n                if let Err(e) = self.tx.send(Some(task)) {\n                    trace!(\"Error sending task: {e:?}\");\n                    self.sent.remove(&key);\n                }\n            }\n        }\n\n        if self.is_empty() {\n            trace!(\"All tasks finished\");\n            if let Err(e) = self.tx.send(None) {\n                trace!(\"Error closing task stream: {e:?}\");\n            }\n        } else if leaves_is_empty && self.sent.len() == self.removed.len() {\n            panic!(\n                \"Infinitive loop detected, all tasks are finished but the graph isn't empty {0} {1:#?}\",\n                self.all().map(|t| t.name.clone()).join(\", \"),\n                self.graph\n            )\n        }\n    }\n\n    /// listened to by `mise run` which gets a stream of tasks to run\n    pub(crate) fn subscribe(&mut self) -> mpsc::UnboundedReceiver<Option<Task>> {\n        let (tx, rx) = mpsc::unbounded_channel();\n        self.tx = tx;\n        self.emit_leaves();\n        rx\n    }\n\n    pub(crate) fn is_empty(&self) -> bool {\n        self.graph.node_count() == 0\n    }","sourceCodeStart":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/task/deps.rs#L365-L401","documentation":"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.","triggerScenarios":"Thrown at src/task/deps.rs:383 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the {1:#?} graph dump in the message for a dependency cycle or orphaned tasks","Fix task removal so removing a batch correctly decrements all dependents' counts","Add cycle detection when building the task graph to reject recursive depends_on"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}