question-streaks lock: release removes a lock it no longer owns

Abierto
#192 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
62/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
bash, shell
Área
tooling

Línea de trabajo

Start in bin/question-streaks.sh at the age check [ "$age" -gt 120 ] that reclaims $LOCK, then follow the release path that calls rmdir without checking ownership. Read the owner-token fix referenced from PR #191 and port that token write/check pattern here, re-checking the token before each rename under the lock. Add a test where holder A stalls past 120 s, B reclaims, and A's release leaves B's lock intact; done when that test and the existing script tests pass.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bin/question-streaks.sh reclaims a lock older than 120 s by age ([ "$age" -gt 120 ] && { rmdir "$LOCK"), and its release removes the lock without checking who holds it. A holder that stalls past 120 s then deletes the reclaimer's lock, and a third writer can race the second.

Same class as the P0 found in the thread index on https://github.com/STRML/autodream/pull/191, fixed there with an owner token that release checks before rmdir, and a token re-check before every rename under the lock. Port that pattern here, with a test where A's aged lock is reclaimed by B and A's release must leave B's lock alone.

Lenguaje dominante
Shell
Estrellas
0
Forks
2
Merge medio
11 h 31 min
PR fusionados (30 d)
26

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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de STRML/autodream

Todos los issues de STRML/autodream

Issues similares

Más issues de Shell/Bash

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.