Possible lost notification in threading.Condition when a waiter times out
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
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
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
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de python/cpython
-
topic-socket type-bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
python/cpython#160561 · 7 comentários ·
Mantenedores costumam responder em até 1 dia
-
tests topic-profiling type-bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
python/cpython#160334 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
`iso2022_jp_3` encodes U+9B1D but decodes the result as U+9B1CTalvez já em andamento @kinqsradio assumiu há 1 dia. Abertaextension-modules type-bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 1 dia
-
Remove unused FVS_* macrosAbertainterpreter-core type-feature
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
python/cpython#160109 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
extension-modules type-bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
python/cpython#160001 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de python/cpython
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
pydot/pydot#601 · 4 comentários ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
letsencrypt/cp-cps#361 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
-
CI: startup_failure because callers grant fewer permissions than ledger-app-workflows@v1 declaresTalvez já em andamento @maykonmichel assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
LedgerHQ/app-boilerplate-rust#227 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
linuxmint/mintupdate#1107 ·