Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback not being used with SSL timeouts #85

Closed
tomczoink opened this issue Nov 28, 2019 · 6 comments · Fixed by #147
Closed

Fallback not being used with SSL timeouts #85

tomczoink opened this issue Nov 28, 2019 · 6 comments · Fixed by #147
Assignees
Labels
bug Something isn't working. It's clear that this does need to be fixed.

Comments

@tomczoink
Copy link

tomczoink commented Nov 28, 2019

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.

@tomczoink tomczoink added the bug Something isn't working. It's clear that this does need to be fixed. label Nov 28, 2019
@MatthewHallCom
Copy link

👋 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.

@SimonWoolf
Copy link
Member

SimonWoolf commented Dec 2, 2019

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.

@jdavid
Copy link
Contributor

jdavid commented Dec 5, 2019

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 );

@mattheworiordan
Copy link
Member

@matthewhall-ca any chance you can share some of the logs when this happens?

@MatthewHallCom
Copy link

@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

@sacOO7 sacOO7 self-assigned this Apr 5, 2022
@sacOO7
Copy link
Collaborator

sacOO7 commented Apr 19, 2022

Improve error logging via #119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. It's clear that this does need to be fixed.
Development

Successfully merging a pull request may close this issue.

6 participants