1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-10-18 13:59:17 +00:00
trezor-firmware/python/.changelog.d/1668.changed
matejcik 0e650b1a5b fix(python): do not set socket to nonblocking for wait_until_ready
There's two udp calls in `UdpTransport._ping()`:
- socket.sendall(b"PINGPING") -> this will be instanteous, AND it will
raise if the receiving side is not listening.
- socket.recv() -> this will wait for SOCKET_TIMEOUT seconds, but only
in case the sendall() succeeded. This means that receiving side exists
and we are now waiting until it's awake enough to respond.

In conclusion, we avoid hammering emulator with PINGPINGs with a timeout
so short we don't see an answer. This should avoid the problem
occasionally seen in CI and described in #1668
2021-08-04 10:58:59 +02:00

2 lines
69 B
Plaintext

`UdpTransport.wait_until_ready` no longer sets socket to nonblocking