signal handler sockets error on close leaving loop in 'running' state indefinitely
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 20/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- backend, networking
Direzione di ricerca
Inizia leggendo uvloop/loop.pyx intorno a Loop._pause_signals e Loop.run_until_complete, quindi esamina la patch catch-exception-on-pause collegata. Riproduci il percorso bad-file-descriptor, incluse chiamate ripetute a run_until_complete, e aggiungi un test di regressione; il lavoro è completato quando il loop non rimane contrassegnato come in esecuzione dopo il fallimento.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
- uvloop version: 0.19.0 and 0.20.0
- Python version: 3.12
- Platform: linux/aws lambda
- Can you reproduce the bug with
PYTHONASYNCIODEBUGin env?: - Does uvloop behave differently from vanilla asyncio? How?: have observed the same error on asyncio
I have not been able to come up with a reproduction for this as I think it has something to do with how aws lambda freezes and thaws lambdas.
I have an aws lambda using uvloop that handles requests with using loop.run_until_complete. I can't use uvloop.run or aysncio.run since I need client connected to that loop to still be present on the next invocation of the lambda. Occassionally we have observed errors on the lambda with the following stack trace:
[ERROR] OSError: [Errno 9] Bad file descriptor
Traceback (most recent call last):
File "/my_code.py", line 302, in request_handler
self.loop.run_until_complete(_process_records())
File "uvloop/loop.pyx", line 1511, in uvloop.loop.Loop.run_until_complete
File "uvloop/loop.pyx", line 1504, in uvloop.loop.Loop.run_until_complete
File "uvloop/loop.pyx", line 1377, in uvloop.loop.Loop.run_forever
File "uvloop/loop.pyx", line 547, in uvloop.loop.Loop._run
File "uvloop/loop.pyx", line 348, in uvloop.loop.Loop._pause_signals
File "/root/.pyenv/versions/3.12.1/lib/python3.12/socket.py", line 504, in close
self._real_close()
File "/root/.pyenv/versions/3.12.1/lib/python3.12/socket.py", line 498, in _real_close
_ss.close(self)
Because this error happens before the loop sets it's self._running field to 0 this means on the next invocation of the lambda the call to loop.run_until_complete errors with a loop is already running error.
I think the bad file descriptor is caused by some feature of the lambda environment or it could just be some kind of random chance since we have a lot of these running and this happens on very small fraction (<0.01%).
I wrote this patch to catch and ignore the Bad file descriptor error, but don't know if that's the right thing to do in the absence of real test case. If anyone has ideas about how I could produce a test case I am happy to try them out.
- Lingua principale
- Cython
- Stelle
- 11.9k
- Fork
- 615
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di MagicStack/uvloop
-
License not clear Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
MagicStack/uvloop#759 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
MagicStack/uvloop#741 · 2 reazioni ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
MagicStack/uvloop#702 · 8 commenti · 9 reazioni ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
MagicStack/uvloop#766 ·
-
Directly constructed subprocess pipe protocols segfault when callbacks use a non-process owner Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
MagicStack/uvloop#765 ·
Tutte le issue di MagicStack/uvloop
Issue simili
-
[Bug]: Discord Activity titles with emoji are rejected as over 80 characters when they are not Apertaclawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
growthbook/growthbook#7100 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
punkpeye/mcp-remote#369 ·
-
Client customer-reported needs-team-attention question Service Attention WebPubSub
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Azure/azure-sdk-for-net#63292 · 3 commenti · 1 reazione ·
-
bug p:3-mid pydanty:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
pydantic/pydantic-ai#8643 · 1 commento ·