You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/06/30 03:24:16 UTC
[GitHub] [apisix] spacewander commented on a change in pull request #4504: feat(batch-requests): check control port conflict when batch-requests is enabled
spacewander commented on a change in pull request #4504:
URL: https://github.com/apache/apisix/pull/4504#discussion_r661101354
##########
File path: apisix/cli/ops.lua
##########
@@ -542,6 +543,29 @@ Please modify "admin_key" in conf/config.yaml .
end
end
+ -- check control port conflict when batch-requests is enabled
+ if enabled_plugins["batch-requests"] and yaml_conf.apisix.enable_control then
Review comment:
Although this only happens when batch-requests is enabled now, I think we can always check if the port conflicts even batch-requests is not enabled.
##########
File path: apisix/cli/ops.lua
##########
@@ -542,6 +543,29 @@ Please modify "admin_key" in conf/config.yaml .
end
end
+ -- check control port conflict when batch-requests is enabled
+ if enabled_plugins["batch-requests"] and yaml_conf.apisix.enable_control then
+ local split = pl_stringx.split
+ local ip_port = split(sys_conf.control_server_addr, ":")
+ local port = tonumber(ip_port[#ip_port])
+ if port == nil then
+ util.die("port not number, should not happen\n")
+ end
+
+ if type(yaml_conf.apisix.node_listen) == "number" then
Review comment:
Maybe we can move the control API stuff above: https://github.com/apache/apisix/blob/d0bc7238c912259e325f45ad6caea039d24e4292/apisix/cli/ops.lua#L410
And use a port denylist to check it when iterating the node_listen? So that we don't need to iterate it twice.
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org