bug(partitions): a_removal_cut_short_leaves_the_marker_in_place panics when tests run as root
Los mantenedores suelen responder en 1 día
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Bug description
partition_storage::tests::a_removal_cut_short_leaves_the_marker_in_place panics when the partitions tests run as root, for example in a Docker container. I expected it to return early, as its comment says: "Root ignores the mode, so nothing would cut the removal short."
The test makes offsets/ read-only (0o500) so that remove_partition_dir stops partway. Root ignores the mode, so the probe remove_file succeeds, blocked is false, and remove_partition_dir deletes the whole directory. The next line restores the mode on offsets, which no longer exists, and its unwrap() panics before the if !blocked check:
let blocked = std::fs::remove_file(offsets.join("1")).is_err();
let result = remove_partition_dir(partition_dir).await;
std::fs::set_permissions(&offsets, Permissions::from_mode(mode)).unwrap(); // NotFound as root
if !blocked {
return;
}
partition_storage.rs#L1106-L1112, added in #4365. CI runs as a non-root user, so it never hits this. As root, the failure also stops cargo test -p partitions before the crate's integration tests run.
Possible fix: return before remove_partition_dir when the probe shows the mode is ignored.
let blocked = std::fs::remove_file(offsets.join("1")).is_err();
if !blocked {
std::fs::set_permissions(&offsets, Permissions::from_mode(mode)).unwrap();
return;
}
let result = remove_partition_dir(partition_dir).await;
std::fs::set_permissions(&offsets, Permissions::from_mode(mode)).unwrap();
Found while running the tests in a Linux container with an AI assistant.
Affected area / component
CI / build / tooling
Deployment
Not applicable
Versions
master at d0fc19a (Nov 4, 2026)
Hardware / environment
Docker Desktop on an Apple silicon Mac, rust:1.99.1-slim-trixie container running as root, kernel 7.0.14-linuxkit
Sample code
No response
Logs
thread 'partition_storage::tests::a_removal_cut_short_leaves_the_marker_in_place' panicked at core/partitions/src/partition_storage.rs:1109:74:
called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
Iggy server config
No response
Reproduction
From the repository root (the container runs as root by default):
docker run --rm --security-opt seccomp=unconfined \
-v "$PWD":/iggy -w /iggy -e CARGO_TARGET_DIR=/tmp/target \
rust:1.99.1-slim-trixie \
cargo test --locked -p partitions --lib -- \
partition_storage::tests::a_removal_cut_short_leaves_the_marker_in_place --exact
seccomp=unconfined lets compio use io_uring. Without it, every compio test fails earlier with "cannot create runtime". The test passes when the same suite runs as a non-root user.
Contribution
- I'm willing to submit a pull request to fix this bug
Good first issue
- I think this could be a good first issue for a new contributor
- Lenguaje dominante
- Rust
- Estrellas
- 5.2k
- Forks
- 502
- Merge medio
- 3 d 3 h
- PR fusionados (30 d)
- 163
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/iggy
-
Go examples: add a message envelope producer and consumerPosiblemente ocupada @ThunderGod77 la tomó hace 3 días. Abiertogo good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
apache/iggy#4694 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
HTTP client treats a consumer group as a plain consumerPosiblemente ocupada @mohitduhan19 la tomó hace 21 días. Abiertobug rust server
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
apache/iggy#4408 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Add the fail-fast connection option to the Rust and Python quick-startsPosiblemente ocupada @QIW9 la tomó hace 9 días. Abiertodocs good first issue
Dificultad 1/5 1-3 horas Aptitud para principiantes 92/100
apache/iggy#4261 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
ResourceNotFound from the binary protocol prints an empty keyPosiblemente ocupada @xalestar la tomó hoy. Abiertoapi python rust
apache/iggy#4767 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Node SDK: send accepts malformed user headers that fail during pollingPosiblemente ocupada @Subham-KRLX la tomó hace 1 día. Abiertobug good first issue javascript
apache/iggy#4750 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/iggy
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 1 día
-
🐞 bug 🧩 bevy_gantz_egui
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
nannou-org/gantz#500 ·
Los mantenedores suelen responder en 1 día
-
[Feature]: Fedora 45 repoAbiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
metasequoiaime/msime#10989 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
fritzprix/libr-agent#2612 ·
Los mantenedores suelen responder en 1 día
-
find: -printf %h drops a doubled slashPosiblemente ocupada @qodelicious la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día