{"record":{"id":"ad7de4a921eacf6c","repo":"Hmbown/CodeWhale","slug":"scheduling-fleet-run-after-draining-owned-worke","errorCode":null,"errorMessage":"scheduling Fleet run {} after draining owned workers","messagePattern":"scheduling Fleet run (.+?) after draining owned workers","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/fleet/manager.rs","lineNumber":784,"sourceCode":"                            manager_lock_path.display()\n                        )\n                    });\n                }\n            }\n        };\n        loop {\n            // A terminal ledger update can race the foreground host process.\n            // Do not lease new work onto a logical worker until its executor\n            // handle has been observed and forgotten below.\n            let unavailable_workers = executor.worker_ids().into_iter().collect();\n            let scheduling_error = self\n                .schedule_run_excluding(run_id, max_workers, &unavailable_workers)\n                .err();\n            self.drive_executor_tick(run_id, executor, codewhale_binary, model)?;\n            self.refresh_run_status(run_id)?;\n            if let Some(error) = scheduling_error {\n                if executor.worker_ids().is_empty() {\n                    return Err(error).with_context(|| {\n                        format!(\n                            \"scheduling Fleet run {} after draining owned workers\",\n                            run_id.0\n                        )\n                    });\n                }\n                tracing::warn!(\n                    run_id = %run_id.0,\n                    error = %error,\n                    \"Fleet scheduling paused while already-leased workers continue\"\n                );\n            }\n            // A separate `fleet interrupt` process can make the ledger\n            // terminal while this manager still owns a live host child. Keep\n            // driving until the executor has observed that cancellation and\n            // stopped every tracked process.\n            if !self.run_has_open_work(run_id)? && executor.worker_ids().is_empty() {\n                return self.run_status(run_id);","sourceCodeStart":766,"sourceCodeEnd":802,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/fleet/manager.rs#L766-L802","documentation":"This is an informational log (not a panic) in the Fleet manager loop: after observing that owned workers are draining, the manager schedules the run while explicitly excluding those worker ids (schedule_run_excluding) so no new work is leased onto a logical worker whose executor handle has not yet been observed and forgotten. It records the deliberate drain-then-schedule decision when a terminal ledger update races the foreground host process.","triggerScenarios":"Thrown at crates/tui/src/fleet/manager.rs:784 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No action needed on the log itself; it confirms scheduling continued on the remaining workers","If scheduling repeatedly happens after draining, investigate why workers keep terminating","Ensure executor.worker_ids() reflects forgotten handles so the exclusion list stays accurate"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}