Bug in timeout connector
prolic opened this issue · comments
The timeout configured is basically ignored. see vendor/amphp/socket/src/functions.php:70.
$timeout = $socketContext->getConnectTimeout();
so the timeout is fetched from socket context, the timeout from the timeout connector is more or less useless.
I found this while having default mysql timeout of 5 secs and got a timeout after 10 secs only.
https://github.com/amphp/socket/blob/c3e4949921cc60de1eb127f963c53d9a7c68ba8a/src/functions.php#L135 needs a race with the cancellation converted to a promise basically.
The issue in amphp/socket
where cancellation requests were not immediately honored was addressed in amphp/socket@2cb9d0e.