]> jfr.im git - irc/unrealircd/unrealircd-rpc-php.git/commit
Workaround library bug in eventloop(). Apparently if there is little
authorBram Matthys <redacted>
Mon, 10 Apr 2023 15:56:19 +0000 (17:56 +0200)
committerBram Matthys <redacted>
Mon, 10 Apr 2023 15:56:19 +0000 (17:56 +0200)
commit49faf2cf73ef44c01ef972a26f93525f6ec8e8ad
tree6e7ae6794e8a034391731b42140282d1802a50dc
parenta3518a0a01aaab2b59db65f211db8bd84cf1441a
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";
}
lib/Connection.php