9268 commented on code in PR #12867:
URL: https://github.com/apache/apisix/pull/12867#discussion_r2882759598


##########
apisix/discovery/nacos/init.lua:
##########
@@ -348,12 +354,27 @@ local function fetch_from_host(base_uri, username, 
password, services)
     end
 
     for key, nodes in pairs(nodes_cache) do
-        local content = core.json.encode(nodes)
-        nacos_dict:set(key, content)
+        local content = core.json.stably_encode(nodes)
+        local ok, err = nacos_dict:safe_set(key, content)
+        if not ok then
+            log.error("failed to set nacos discovery content for key: ", key,
+                      ", error: ", err)
+            -- No further action possible beyond logging the error

Review Comment:
   delete version does no help to discovered node data,there's nothing we can 
do when node data write fail。
   version data can be delete when update,workers can check and re get node 
info,at this point,worker will fetch dict every req。



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to