You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configuration loading implementation is based on the proposal in #230.
Over time it evolved a bit and we should re-evaluate how it is being loaded.
It is not obvious how many times, when exactly it is loaded or how long it takes.
We should try to design a solution that will:
load the configuration only once (even across multiple workers)
work for both lazy and boot modes
be able to print precise timestamps when and how long it took, including debugging logs what the configuration was and the response codes
https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/process.md allows starting a privileged process. There will be exactly one. If it is killed, it will be restarted. It can run init_worker phase. This would be ideal for an infinite timer, that would periodically refresh configuration. It also allows getting master PID.
https://github.com/openresty/lua-resty-signal allows sending signals to processes. Theoretically signalling master process to do a full reload. That would gracefully exit all workers, load new configuration and start the new master process.
For lazy loading, the situation is a bit harder, but still, we could try to have an internal API over UNIX socket, that would allow sharing configuration between multiple workers. The only methods of sharing configuration between workers are shared memory ngx.dict or some internal API (that still uses shared memory).
The text was updated successfully, but these errors were encountered:
I'll start with offering the option to loading services one by one when they're needed instead of all of them when using APICAST_CONFIGURATION_LOADER = lazy.
Configuration loading implementation is based on the proposal in #230.
Over time it evolved a bit and we should re-evaluate how it is being loaded.
It is not obvious how many times, when exactly it is loaded or how long it takes.
We should try to design a solution that will:
With https://github.com/openresty/lua-resty-shell it should be possible to start and asynchronously read from external processes (needed to make requests in init phase).
https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/errlog.md#raw_log allows for cleaner errors messages without extra bloat.
https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/process.md allows starting a privileged process. There will be exactly one. If it is killed, it will be restarted. It can run init_worker phase. This would be ideal for an infinite timer, that would periodically refresh configuration. It also allows getting master PID.
https://github.com/openresty/lua-resty-signal allows sending signals to processes. Theoretically signalling master process to do a full reload. That would gracefully exit all workers, load new configuration and start the new master process.
For lazy loading, the situation is a bit harder, but still, we could try to have an internal API over UNIX socket, that would allow sharing configuration between multiple workers. The only methods of sharing configuration between workers are shared memory
ngx.dict
or some internal API (that still uses shared memory).The text was updated successfully, but these errors were encountered: