You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
uselect: poll instance produces unexpected results under fault conditions #4290
Context: uasyncioStreamReader and StreamWriter objects hang indefinitely under fault conditions.
Under fault conditions uasyncio expects to receive POLLERR or POLLHUP conditions from the poll instance. In my testing this never occurs.
Testing was of client connections. Socket type was SOCK_STREAM. Two fault conditions were tested:
Server outage.
Socket closed by another coroutine.
Testing was performed with a server running under the Unix build. Clients were tested on:
Unix build (on same machine as server).
ESP8266.
ESP32.
Results were as follows. Numbers represent the event no. received from the poll instance. "No trigger" means that the poll instance produced no response after the fault. On all platforms where the client was reading, a server outage produced a POLLIN (1) response. On all but ESP32 this repeated indefinitely causing the client endlessly to read empty bytes objects.
Numbers are base 10. Mode refers to the client mode. Expected refers to uasyncio.
Activity
extmod/modlwip: Unconditionally return POLLHUP when polling new socket.
extmod/modlwip: Unconditionally return POLLHUP when polling new socket.
extmod/modlwip: Unconditionally return POLLHUP/POLLERR when polling.
dpgeorge commentedon Oct 31, 2019
This should be partially fixed by 71401d5, feaa251 and 26d8fd2
It remains to fully test all cases above to check they work correctly (or not, and fix them).
extmod/modlwip: Unconditionally return POLLHUP when polling new socket.
extmod/modlwip: Unconditionally return POLLHUP/POLLERR when polling.
extmod/modlwip: Unconditionally return POLLHUP when polling new socket.
extmod/modlwip: Unconditionally return POLLHUP/POLLERR when polling.
agatti commentedon Jun 10, 2026
@peterhinch is this issue still valid?
peterhinch commentedon Jun 11, 2026
I have run the test scripts on all three platforms with V1.28 firmware: response to a socket outage is now clean in every case.
extmod/modlwip: Unconditionally return POLLHUP when polling new socket.
extmod/modlwip: Unconditionally return POLLHUP/POLLERR when polling.