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
when I try a command on a connection where the MC Server died or restarted, it results in python using an full CPU Core:
from mcrcon import MCRcon
import time
import os
rcon = MCRcon(os.environ['RCON_HOST'],os.environ['RCON_PASSWORD'],port=int(os.environ['RCON_PORT']))
rcon.connect()
time.sleep(10) # server stopped or died here
rcon.command("list")
the command never stops. the only way to recover from that is to restart the python script. Maybe a Timeout for Command or the connection would make sense.
Related: Joshi425/minecraft-exporter#11
The text was updated successfully, but these errors were encountered:
Sorry, haven't played with anything Minecraft related in ages, and likely won't have a chance to fix this myself. But if you feel like opening a pull request which adds a timeout I will happily review/test it, then release a new version to pypi.
This is an issue I assume is caused by the socket being implemented as 'blocking'. If I have time, I'll look into it and fix it so that it uses a non-blocking socket. As for now I have forked the repo and will create a pull request as soon as I have it working.
So I've now merged and released a version that supports timeout. Which should mostly handle this... but @steveroch-rs if you want to still have a go at implementing non-blocking sockets, we can instead switch to that, but timeout should work for now.
Hi there,
when I try a command on a connection where the MC Server died or restarted, it results in python using an full CPU Core:
the command never stops. the only way to recover from that is to restart the python script. Maybe a Timeout for Command or the connection would make sense.
Related: Joshi425/minecraft-exporter#11
The text was updated successfully, but these errors were encountered: