nic-6443 commented on code in PR #12523:
URL: https://github.com/apache/apisix/pull/12523#discussion_r2281496008


##########
apisix/core/config_etcd.lua:
##########
@@ -1157,8 +1168,14 @@ function _M.init_worker()
         return nil, err
     end
 
-    if table.try_read_attr(local_conf, "apisix", 
"disable_sync_configuration_during_start") then
-        return true
+    -- if the startup time of a worker differs significantly from that of the 
master process,
+    -- we consider it to have restarted, and at this point,
+    -- it is necessary to reload the full configuration from etcd.
+    if configuration_loaded_time and ngx_time() - configuration_loaded_time > 
60 then

Review Comment:
   This is an empirical value. I think 60 seconds is a sufficient duration to 
distinguish between the worker's first-time and restart scenarios. It can be 
made into a configuration parameter, but I don't think users would know how to 
set this configuration parameter properly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to