This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: asyncio DatagramProtocol stops calling callbacks after OSError
Type: behavior Stage:
Components: asyncio Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: JulianOrteil, Thomas Trummer, asvetlov, sim1234, yselivanov
Priority: normal Keywords:

Created on 2021-07-26 14:50 by JulianOrteil, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
reproducible_datagramprotocol_error.py JulianOrteil, 2021-07-26 14:50 Reproducible code
Messages (2)
msg398229 - (view) Author: Julian_Orteil (JulianOrteil) Date: 2021-07-26 14:50
After working through the Transports and Protocols documentation of asyncio, I decided to stress test the DatagramProtocol as an application I'm developing needs to act as a UDP server.

One of my tests drops the client before the server responds which raises an OSError on the server; however, after the error is raised, the server stops executing callbacks (like connection_made, datagram_received, error_received and connection_lost) until it is restarted. There is no documentation I can find that explains this behavior nor is there any meaningful discussions about it elsewhere. I don't think the socket itself drops because the client doesn't raise an OSError itself when connecting to the now-errored server.

Interestingly though, when I tried to enable debug mode of the loops on both the client to see if there were any silent errors being raised (which didn't occur), this issue doesn't occur. Enabling debug mode on the server had no effect.

Attached is the reproducible code; it is a slightly modified version of the UDP Echo Client/Server example found in the docs named above. My environment is Python 3.9.5 on Windows 10.
msg406332 - (view) Author: Szymon (sim1234) Date: 2021-11-14 20:12
I'm experiencing the same exact issue. The bug manifests with all combinations: SelectorEventLoop and ProactorEventLoop, python 3.9 and 3.10, on Windows 10. Python 3.8 on Linux seems to not be affected. Can we get a fix or at least an update?
History
Date User Action Args
2022-04-11 14:59:47adminsetgithub: 88906
2021-11-14 20:12:24sim1234setnosy: + sim1234
messages: + msg406332
2021-08-18 14:15:54Thomas Trummersetnosy: + Thomas Trummer
2021-07-26 14:50:58JulianOrteilcreate