From: Bram Matthys Date: Mon, 10 Apr 2023 15:56:19 +0000 (+0200) Subject: Workaround library bug in eventloop(). Apparently if there is little X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-rpc-php.git/commitdiff_plain/49faf2cf73ef44c01ef972a26f93525f6ec8e8ad?ds=sidebyside;hp=49faf2cf73ef44c01ef972a26f93525f6ec8e8ad Workaround library bug in eventloop(). Apparently if there is little activity and we catch the timeout once and we continue, then if there is some other error like server killed or otherwise connection lost then it will refire as a timeout, and this happens endlessly, so resulting in 100% CPU loop. We now detect it by (far) too little execution time, ah well, it is a workaround that works :D. So this should be safe now (was introduced a previous commit, still the same code): $rpc->log()->subscribe(Array("!debug","all")); while(1) { echo "Waiting...\n"; $res = $rpc->eventloop(); var_export($res); echo "\n"; } ---