-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix(TaskProcessing\Manager): Always use distributed cache and use PHP serialize #50640
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
Conversation
… serialize Signed-off-by: Marcel Klehr <[email protected]>
3949475 to
49a5212
Compare
julien-nc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional change.
Co-authored-by: Julien Veyssier <[email protected]> Signed-off-by: Marcel Klehr <[email protected]>
… serialize Signed-off-by: Marcel Klehr <[email protected]>
|
/backport to stable31 |
|
/backport to stable30 |
|
|
||
| $this->availableTaskTypes = $availableTaskTypes; | ||
| $this->cache->set('available_task_types', $this->availableTaskTypes, 60); | ||
| $this->distributedCache->set('available_task_types_v2', serialize($this->availableTaskTypes), 60); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @marcelklehr, I'm curious why a distributed cache is preferred here? Doesn't this increase the latency of the request? Is there a need to synchronize the cached value across all application servers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey
Is there a need to synchronize the cached value across all application servers?
I think so, yes, they should all have the same value to avoid failing tasks sent from the state of one server and received on a different server. The chance of that happening is slim, though, as the cached value shouldn't change very often.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to adjust the code to handle the case more gracefully? A local cache has a very low latency and scales horizontally. The distributed cache has high latency and creates a bottleneck when scaling out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, what do you have in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they should all have the same value to avoid failing tasks sent from the state of one server and received on a different server.
handling this case better, and using the local cache again.
Checklist