{"record":{"id":"fe30b416cd36fc50","repo":"zed-industries/zed","slug":"failed-to-write-example","errorCode":null,"errorMessage":"Failed to write example","messagePattern":"Failed to write example","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/edit_prediction_cli/src/main.rs","lineNumber":1282,"sourceCode":"                        in_place_temp_path = Some(temp.clone());\n                        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 {","sourceCodeStart":1264,"sourceCodeEnd":1300,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction_cli/src/main.rs#L1264-L1300","documentation":"Panics when writing one example's JSON line to the buffered output writer fails mid-run (disk full, I/O error). Results for that run may be partially written; the resume mechanism can recover via kept hashes.","triggerScenarios":"Thrown at crates/edit_prediction_cli/src/main.rs:1282 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Free disk space and re-run; resume skips already-processed examples","Check the output file for truncation after the error"],"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-14T00:17:10.932Z"}