Closed tomczoink closed 2 years ago
👋 This is us! We're seeing this with our Broadcaster for Laravel package that extends ably-php https://github.com/springboardVR/Laravel-Ably-Broadcaster
It looks like it mostly is happening when we're doing $ablyChannel->publish($event, $payload);
multiple times very quickly. Happening between 50 to 100 times per day for us.
Fallback not being used with SSL timeouts #85
and try to use the fallback host.
To clarify, the task here to to check whether or not that error is triggering a fallback to be used. It should be, but the fact that a customer is seeing the error is evidence that it might not be (as it's unlikely that all fallbacks tried would all give an ssl timeout), so we don't currently know whether it is or not.
There're a number of unit tests regarding fallback hosts, for instance: https://github.com/ably/ably-php/blob/master/tests/AblyRestTest.php#L185 https://travis-ci.org/ably/ably-php/jobs/621057124#L290
That error can only be produced in https://github.com/ably/ably-php/blob/master/src/Http.php#L161
It's the only place the error string cURL error:
is used. There we set the 50003 error code. We try fallback hosts in this case, only error codes below 50000 are thrown immediately, see https://github.com/ably/ably-php/blob/master/src/AblyRest.php#L273 (this is verified in the unit test above).
With log level set to error you should see a message for every failed attempt. The default is warning, so you should see them.
By default fallbacks will be used, you can verify the list of fallback hosts with:
$ably = new AblyRest( $opts );
print_r( $ably->options->fallbackHosts );
@matthewhall-ca any chance you can share some of the logs when this happens?
@matthewhall-ca any chance you can share some of the logs when this happens?
It hasn't happened in a while! Will let you know when it does
Improve error logging via #119
We've had a report from a customer that when publishing, they'll sometimes see
Ably\Exceptions\AblyRequestException cURL error: SSL connection timeout
and try to use the fallback host.