Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Possible lost notification in threading.Condition when a waiter times out

Abierto
#160,414 3 comentarios 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
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
backend

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

extension-modules type-bug
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

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

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 python/cpython

Todos los issues de python/cpython

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.