New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reliable way to detect if emulator is up #1668
Labels
Projects
Comments
FWIW: something wrong is going on with More generally, however, it's still not doing it reliably. |
matejcik
added a commit
that referenced
this issue
Jul 30, 2021
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
Merged
matejcik
added a commit
that referenced
this issue
Jul 30, 2021
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
matejcik
added a commit
that referenced
this issue
Jul 30, 2021
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
matejcik
added a commit
that referenced
this issue
Aug 4, 2021
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently the library repeatedly sends UDP message
PINGPING
, until the emulator responds withPONGPONG
. If that does not happen within 1 second, emulator is considered dead.This opens some interesting race conditions. In particular, what occasionally seems to happen in test runs:
The reason host hammers emulator with PINPINGs is that as of workflow-restarts, there's no guarantee that a running emulator will respond to a PONGPONG in a timely fashion.
There are various possible solutions to the issue. We need to figure out one that's actually reliable and not affected by whether, e.g., the emulator is currently running an event loop.
The text was updated successfully, but these errors were encountered: