[New-bugs-announce] [issue44743] asyncio DatagramProtocol stops calling callbacks after OSError

Julian_Orteil report at bugs.python.org
Mon Jul 26 10:50:58 EDT 2021


New submission from Julian_Orteil <dakota.horstman2001 at gmail.com>:

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.

----------
components: asyncio
files: reproducible_datagramprotocol_error.py
messages: 398229
nosy: JulianOrteil, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: asyncio DatagramProtocol stops calling callbacks after OSError
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file50183/reproducible_datagramprotocol_error.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44743>
_______________________________________


More information about the New-bugs-announce mailing list