Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

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

Aberta
#160,414 3 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
35/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
python
Domínio
backend

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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
Linguagem predominante
Python
Estrelas
77.7k
Forks
38.3k
Merge médio
13h 43min
PRs com merge (30d)
704

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de python/cpython

Todas as issues de python/cpython

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.