{"record":{"id":"3c3a5af3ff21cd12","repo":"zed-industries/zed","slug":"failed-to-flush-output","errorCode":null,"errorMessage":"Failed to flush output","messagePattern":"Failed to flush output","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/edit_prediction_cli/src/main.rs","lineNumber":1283,"sourceCode":"                        temp\n                    } else {\n                        output_path.clone()\n                    };\n\n                    let file = OpenOptions::new()\n                        .create(true)\n                        .write(true)\n                        .truncate(args.in_place)\n                        .append(!args.in_place)\n                        .open(&write_path)\n                        .expect(\"Failed to open output file\");\n\n                    let mut writer = BufWriter::new(file);\n                    let (sender, mut receiver) = mpsc::unbounded::<String>();\n                    cx.background_spawn(async move {\n                        while let Some(line) = receiver.next().await {\n                            writeln!(writer, \"{}\", line).expect(\"Failed to write example\");\n                            writer.flush().expect(\"Failed to flush output\");\n                        }\n                    })\n                    .detach();\n                    output_sender = Some(sender);\n                }\n\n                let example_batches = if args.group_by_repo {\n                    group_examples_by_repo(examples)\n                } else {\n                    chunk_examples(examples, args.max_parallelism)\n                };\n                let example_batches = Mutex::new(example_batches);\n                let finished_examples = Mutex::new(Vec::new());\n\n                let mut tasks = Vec::new();\n                for _ in 0..args.max_parallelism {\n                    tasks.push(async {\n                        loop {","sourceCodeStart":1265,"sourceCodeEnd":1301,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction_cli/src/main.rs#L1265-L1301","documentation":"A panic in the edit-prediction CLI when flushing the buffered output writer after writing results fails — typically disk full or I/O error on the output file. Buffered results would be lost, so the CLI aborts rather than silently truncate output.","triggerScenarios":"Thrown at crates/edit_prediction_cli/src/main.rs:1283 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Free disk space and re-run with resume enabled","Inspect the output file for missing trailing lines"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}