-
Notifications
You must be signed in to change notification settings - Fork 125
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
p2pool hangs if monerod is not running #183
Comments
Yes, confirmed this appears to resolve the issue. Thanks! |
This change does seem to have the side effect of dumping core:
|
This is a different bug, fixed in 4ec0fe8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If there is nothing listening on port 18081 when p2ppol make an rpc call (get_info) there is no connection timeout triggered and p2pool hangs forever. This can be reproduced on linux by simply starting p2pool when monerod is not running:
./p2pool --host 127.0.0.1 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg
libuv is calling epoll_wait with infinite timeout:
0x00007ffff7bf146e in epoll_wait (epfd=4, events=0x7fffffff9ac0, maxevents=1024, timeout=-1) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
Im guessing there is supposed to be some kind of libuv timeout triggered for this case, but none is.
In contrast, if something is listening on the monero rpc port 18081 but fails to reposond, there is a timeout triggered and p2pool does retry the call. This can be reproduced on linux using socat:
shell 1:
$ socat TCP-LISTEN:18081 stdout
shell 2:
$ ./p2pool --host 127.0.0.1 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg
shell 1:
shell 2:
But then, the socat process exits and nothing is listening on port 18081 and the second call made by p2pool hangs and waits forever. It appears that libuv timeouts are working for connected sockets that dont reply in time, but not for socket connection timeouts when no process is listening at all.
Note that even if monerod is started after p2pool hangs while attempting a connection, p2pool does not recover and must be restarted before it makes the next rpc request.
The text was updated successfully, but these errors were encountered: