Skip to content

[UPD] Added retries if exception is BUSY - #190

Open
IJOL wants to merge 1 commit into
colinmollenhour:masterfrom
BITVAX:add-retries-if-busy-error
Open

IJOL wants to merge 1 commit into
colinmollenhour:masterfrom
BITVAX:add-retries-if-busy-error

Conversation

@IJOL

@IJOL IJOL commented Jul 29, 2024

Copy link
Copy Markdown

No description provided.

Comment thread Client.php
$response = $this->read_reply($name);
$response = $this->decode_reply($name, $response, $trackedArgs);
$retryCount = 0;
$maxRetries = 5;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A hard-coded retry count really isn't appropriate, this should be linked to a configurable and probably with a lower limit or disabled by default.

Comment thread Client.php
$retryCount++;
if ($retryCount >= $maxRetries) {
throw $e; // Rethrow exception after max retries
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If retrying because of busy, wouldn't it make sense to have a configurable exponential backoff instead of instant retrying?

@colinmollenhour

Copy link
Copy Markdown
Owner

Just FYI, in case this is related to Cm_Cache_Backed_Redis and garbage collection you may be interested in this PR: colinmollenhour/Cm_Cache_Backend_Redis#185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants