-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
BUG: Error when Redis not ready #3284
Comments
The public function get(string $entryIdentifier)
{
$tries = 1;
do {
try {
$result = $this->redis->get($this->getPrefixedIdentifier('entry:' . $entryIdentifier));
break;
} catch (\RedisException $exception) {
} finally {
if ($tries > 10) {
throw $exception;
}
usleep($tries * 100);
$tries++;
}
} while (true);
return $this->uncompress($result);
} |
Totally could and should, two things come to mind: incrementally increase sleep time (maybe going from 1 up with ^2) and we would need to etst what happens in case of a full outtage, because if then multiple gets potentially wait before something crashes it could get long and lead to a self DDos kind of state? And we might want to do that for set and other stuff as well? Also IMHO this particular case going wrong should be fixed in deployment, the ready state of redis before deployment is "live" should be bound to the loading being finished I guess. |
It does that, but you want it to be exponential? Yeah, why not.
Not sure we need that. The effect I see is that Flow tries to read something while still doing "compile stuff", so if that waits for Redis to become ready, anything after that would work. I'd say writing before even attempting to read is an edge-case, no?
That was my immediate reaction, but some Redis commands do work before Redis is done loading, so it is expected behaviour for it to accept connections. |
Is there an existing issue for this?
Current Behavior
In a project we are seing exceptions after a deployment. The cause is a failing doctrine proxy compilation step early on, that in turn is caused by the
RedisBackend
trying to read Redis, but that just says:LOADING Redis is loading the dataset in memory
.Expected Behavior
It should "Just Work" (tm) 🙃
Steps To Reproduce
No response
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: