tzssangglass commented on code in PR #6960:
URL: https://github.com/apache/apisix/pull/6960#discussion_r867745588


##########
apisix/stream/xrpc/runner.lua:
##########
@@ -93,11 +93,13 @@ local function run_log_plugin(ctx, logger)
     local pkg_name = "apisix.stream.plugins." .. logger.name
     local ok, plugin = pcall(require, pkg_name)
     if not ok then
-        core.log.error("failed to load plugin [", plugin, "] err: ", plugin)
+        core.log.error("failed to load plugin [", logger.name, "] err: ", 
plugin)
         return
     end
 
-    core.ctx.set_vars_meta(ctx)
+    -- we choose to initialize conf_id and conf_type here
+    -- because conf here refers specifically to the conf in the log phase,
+    -- to avoid overwriting the conf in other parts of the protocol
     ctx.conf_id = tostring(logger.conf)
     ctx.conf_type = "xrpc-logger"

Review Comment:
   update



##########
t/xrpc/apisix/stream/xrpc/protocols/pingpong/init.lua:
##########
@@ -76,6 +76,12 @@ local function to_int32(p, idx)
 end
 
 
+local function init_ctx_fileds(ctx)
+    -- init some ctx fields
+    core.ctx.set_vars_meta(ctx)

Review Comment:
   update



-- 
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