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
Periodically send refresh signal to Application #473
base: master
Are you sure you want to change the base?
Conversation
Thank you for the time to write this PR. I must admit though, that I'm not sure I like the approach. We used to have a Would something like that work for you? |
Thanks @andig for the feedback. In any case, we will test this implementation for our use case and get back to you with hopefully some useful learnings. |
Once you have async processes rhey could negotiate refreshes amongst themselves using round robin (and a KV store) or any other mechanism. |
That would not prevent the balancer from sending requests to workers that are refreshing/reloading because the worker state cannot be shared with the main process. what exactly is it about this approach, that is bugging you? |
It is a very specific requirement with a lot of code while, at the same time, we might have one or two long-standing issues. As for the master sending requests to the client that would not matter as long as they are async as suggested. Long story short: I feel your PR is a bit beyond the scope of this library. |
async or not, if the worker is busy fetching and preparing data, it will not be handling any requests and thus the request will be queued. Anyway, i understand your concern as in this PR kind of being out of scope and the solution to narrow or rather too use case specific. I will think about a different and more generic approach. And maybe keeping in mind issue 463 |
Thanks for your understanding. But please also consider that if the worker is async he can well refresh state and handle request concurrently. |
Sure, if you rebuild your app to use non blocking deserialisation, db queries and disc I/O operations. But if not, the worker will be blocked on all those operations, regardless of any event loop. |
Hi @Fitzel , you could periodically send a signal to the master process in order to gracefully reload the slaves, I guess that would work? |
I primarily use PPM to have all kinds of data ready for computation at runtime when a request is coming in. In order for that data to be fresh, i need to reload periodically.
Because
ttl
only reloads after a request, i cannot be sure that my data is fresh.Also, with this feature the worker does not get killed but only the method
refreshApplication()
will be fired on the bridge everyrefresh-interval
seconds.Note: Only ¼ of the workers in
ready
state and ready to refresh will be sent to refresh once every 5 seconds.