Possible lost notification in threading.Condition when a waiter times out
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start by reading threading.Condition in Lib/threading.py and its tests under Lib/test; the report concerns timeout handling when multiple waiters share a condition and notify(1) is called. Reproduce the two-waiter timing scenario, then check whether a notification can be consumed after a waiter's timeout. Done means the behavior is clarified or corrected and covered by a regression test; the issue links PR 160503.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug report
Hi,
I noticed some unexpected behavior while testing threading.Condition on Python 3.14.4.
I created two threads waiting on the same condition. The first thread has a short timeout, while the second has a longer timeout. I then held the condition lock until the first waiter's timeout expired and called notify(1).
In my test, both wait() calls returned False, even though I called notify(1) while two waiters were still present in the internal wait queue. I observed the same result in 100 consecutive runs.
I'm not sure whether this is expected behavior or a race condition in how timed-out waiters are handled. Could someone clarify whether this behavior is expected? If not, it may be possible for a notification to be consumed by a waiter whose timeout has already expired, leaving another waiter waiting until its own timeout.
I can provide the minimal reproduction script and terminal output to help investigate.
CPython versions tested on:
3.14
Operating systems tested on:
Linux
Linked PRs
- gh-160503
- Lenguaje dominante
- Python
- Estrellas
- 77.8k
- Forks
- 37.7k
- Merge medio
- 12 h 14 min
- PR fusionados (30 d)
- 729
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni 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 python/cpython
-
tests topic-profiling type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
python/cpython#160881 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
3.16 build pending type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
python/cpython#160829 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
dependencies infra topic-ensurepip
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
symtable: repr() of a Symbol raises TypeError under -X lazy_imports=allPosiblemente ocupada @anistark la tomó hace 1 día. Abiertostdlib topic-lazy-imports type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
python/cpython#160810 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
tarfile: extractfile(member).read() of a sparse member is slow due to repeated bytes concatenationPosiblemente ocupada @devdavidejesus la tomó hace 1 día. Abiertoperformance stdlib triaged type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
python/cpython#160774 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de python/cpython
Issues similares
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
awslabs/visual-asset-management-system#937 ·
Los mantenedores suelen responder en 1 día
-
Admin member of a research group cannot see the HX2 allocation until they've been added to itAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
follow-up
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 83/100
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 2 días