zed-industries/zed · error

Failed to write example

Error message

Failed to write example

What it means

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.

Source

Thrown at crates/edit_prediction_cli/src/main.rs:1282

                        in_place_temp_path = Some(temp.clone());
                        temp
                    } else {
                        output_path.clone()
                    };

                    let file = OpenOptions::new()
                        .create(true)
                        .write(true)
                        .truncate(args.in_place)
                        .append(!args.in_place)
                        .open(&write_path)
                        .expect("Failed to open output file");

                    let mut writer = BufWriter::new(file);
                    let (sender, mut receiver) = mpsc::unbounded::<String>();
                    cx.background_spawn(async move {
                        while let Some(line) = receiver.next().await {
                            writeln!(writer, "{}", line).expect("Failed to write example");
                            writer.flush().expect("Failed to flush output");
                        }
                    })
                    .detach();
                    output_sender = Some(sender);
                }

                let example_batches = if args.group_by_repo {
                    group_examples_by_repo(examples)
                } else {
                    chunk_examples(examples, args.max_parallelism)
                };
                let example_batches = Mutex::new(example_batches);
                let finished_examples = Mutex::new(Vec::new());

                let mut tasks = Vec::new();
                for _ in 0..args.max_parallelism {
                    tasks.push(async {

View on GitHub (pinned to f4178619ac)

Solutions

  1. Free disk space and re-run; resume skips already-processed examples
  2. Check the output file for truncation after the error
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at crates/edit_prediction_cli/src/main.rs:1282 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/fe30b416cd36fc50. Report an issue: GitHub.