Windows: mutation guard rethrows EPERM from a lock dir being deleted, so the ingest-seq reserve skips its retry
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 77/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, node.js
Línea de trabajo
Lee en src/core/util/mutation_guard.js el manejo de errores alrededor de mkdirSync y readdirSync; después, revisa la lógica de reintentos en src/core/cache/ingest-seq.js. Usa como regresión la prueba del asignador en procesos separados que falla y que se menciona en el issue, y ejecútala en Windows. Se considera terminado cuando EPERM o EBUSY durante la liberación siguen la ruta de reintento por recurso ocupado y la prueba de reserva pasa.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
On Windows, claimPartitionMutation can throw a raw EPERM instead of its busy refusal. The ingest-seq allocator then skips its retry, and a commit that should have waited a few milliseconds fails.
src/core/util/mutation_guard.js (master 135887e3):
- Line 52: the claim's
mkdirSync(directory)fails withEEXISTbecause another process holds the guard. - Line 60: we
readdirSync(directory)to find out who holds it. - Line 64: only
ENOENTfrom that read becomes the busy refusal, which covers the holder letting go between our mkdir and our read. Any other code is rethrown.
On win32, a directory that another process is deleting stays in a "delete pending" state for a moment. A readdir on it in that window fails with EPERM, not ENOENT. That is the same race the ENOENT arm is there for (the holder is releasing), but it skips the arm and escapes as an ordinary error.
src/core/cache/ingest-seq.js:170 retries reserve only when isPartitionMutationBusy(error) is true (up to RESERVE_RETRY_LIMIT 200 tries, 25 ms apart). So the raw EPERM ends the reserve at once. Storage calls reserve from src/core/cache/storage.js:302 and :416. Per the #2885 review, the chunk then goes back to the spool and is committed on a later tick: a delayed write, not a lost row.
Evidence
- CI run 41989450420, attempt 2, job 127122055863 (the new
test-windowsjob from #2885, Node v26.13.0). - The failing test was
allocators in separate processes reserve disjoint runs with no gap and leave no lock behind:
Error: EPERM: operation not permitted, scandir '...\hyp-seq-xproc-FVg4h5\._hyp_ingest_seq.json.mutation-lock'
at Object.readdirSync (node:fs:1956:26)
at claimPartitionMutation (file:///D:/a/hypaware/hypaware/src/core/util/mutation_guard.js:60:22)
at file:///D:/a/hypaware/hypaware/src/core/cache/partition.js:52:21
at async Object.reserve (file:///D:/a/hypaware/hypaware/src/core/cache/ingest-seq.js:161:16)
- The code is not new.
mutation_guard.jslast changed in #2658, and neither #2885 nor #2881 touches it. Until #2885 added Windows CI, nothing ran this test on Windows. - POSIX is not affected: Linux and macOS return
ENOENThere, and the existing arm handles it.
Proposed fix
On win32, also treat EPERM (and EBUSY) from that readdirSync as the busy refusal. The holder is mid-release, so the caller's normal retry is the right response. POSIX behavior stays as it is.
When fixing it, check whether the line 52 mkdirSync can also fail with EPERM during the same delete-pending window. Today that path would throw rather than report busy.
The test above is the regression: it should pass on test-windows.
- Lenguaje dominante
- JavaScript
- Estrellas
- 11
- Forks
- 0
- Merge medio
- 2 h 25 min
- PR fusionados (30 d)
- 311
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 hyparam/hypaware
-
docs: ollama.md says --source ollama adds to an existing install, but without --force it refusesAbierto
Dificultad 2/5 Menos de una hora Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
report_commands.js runtime output still says 'server' in four places; one names the destinationAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
Todos los issues de hyparam/hypaware
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Fei-Away/Codex-Dream-Skin#449 ·
Los mantenedores suelen responder en 1 día
-
Claude Code plugin does not wire the edit-time Floor hookPosiblemente ocupada @dgr8akki la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 4 días
-
Administration: required plugin configuration field stays invalid after restoring its saved valueAbiertoneeds-triage Platform(Default)
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
nearform/ag-grid-url-sync#314 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
chore
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
idean3885/claude-ops-agent#910 ·
Los mantenedores suelen responder en 1 día