Closed JakubMatejka closed 8 years ago
Hey @JakubMatejka! Thanks for opening this issue. We are gearing up for more work on the PHP SDK right now and will be looking more into this. We will keep this issue up to date.
Anything new on this? The connections issues today cause a lot of grief.
Anything new on this? I've actually had to disable this tool after the last outage.
@J-who Nothing new to report right now. In the next update of the SDK, we have this issue on the list of things to do. Sorry I don't have better news.
@tbarn Just out of curiosity, when should that next update happen? I reported this bug exactly four months ago and to be honest I don't understand the problem with fixing it. In my opinion bugs are to be fixed immediately and not to be waiting for some release date. Even when this one is so easy to fix and at the same time so annoying for the users (paying users to be exact).
It doesn't represent any problem for me anymore, I built my own retry mechanism around it rather than waiting for the fix but it is little bit "shameful" for your company I guess. If anyone needs to fix this, look to my solution here: https://github.com/keboola/gooddata-writer/blob/master/Service/KeenIO/KeenIOClient.php#L90 It is just simple wait & retry on any failure with fixed number of repetitions and 10-30 seconds wait (I think more complex solutions like exponential backoff aren't appropriate because nature of the outages is accidental and short lasting - and we are talking about "temporary" solution, right?)
@JakubMatejka There's other SDKs being worked on right now, so I can't tell you an exact date. We are always open to pull requests and show our deepest appreciation for those who submit them. We very much consider our SDKs to be open source projects. We don't wait until release dates to push new versions of our SDKs. After a PR is submitted and reviewed, it gets released almost immediately.
In the latest update of this SDK, which was pushed to Packagist last week after the API reference docs were updated with all recent updates, we decided to suggest using existing Guzzle plugins like you suggested. You can see the commit here: https://github.com/keenlabs/KeenClient-PHP/commit/605af5713266da8f934f7a3aa1cf828bceb59609
The code would look something like this:
use KeenIO\Client\KeenIOClient;
$client = KeenIOClient::factory([
'projectId' => $projectId,
'writeKey' => $writeKey,
'readKey' => $readKey
]);
// Use a static factory method to get a backoff plugin using the exponential backoff strategy
$backoffPlugin = BackoffPlugin::getExponentialBackoff();
// Add the backoff plugin to the client object
$client->addSubscriber($backoffPlugin);
We are constantly fixing bug fixes. Currently, since the plugin can be used and we added documentation to help with that, it didn't get fixed immediately like an urgent bug within the Keen IO API would. Would including the code I included in the README.md help resolve the issue for you?
@J-who are you okay with using the retry plugin for your use case? Hopefully the code I included is useful.
@tbarn That's great, I haven't realized that I can pass the backoff plugin directly to the keen.io client. It is perfectly sufficient to know it and notion in readme file would be fine. Well, I didn't create pull request because I wasn't sure if my suggestion is preferable for you, I was expecting rather some discussion about it. Anyway, thanks, I guess we can close this issue.
@tbarn Yeah looks like that'll work, I'll give it a shot. Thanks!
Hi,
We get one or two curl 35 errors a day and it starts to be unpleasant. Could you consider using some backoff and retry mechanism to prevent them? Guzzle 3.7 even has backoff strategy plugin which would catch it: https://github.com/guzzle/guzzle/blob/v3.7.4/src/Guzzle/Plugin/Backoff/CurlBackoffStrategy.php
The stacktrace looks like: