Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[bugfix] generate the 'worker_cpu_affinity' config #1658

Merged
merged 6 commits into from
Jun 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .travis/apisix_cli_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ done
sed -i '/dns_resolver:/,+4s/^#//' conf/config.yaml
echo "passed: system nameserver imported"

# check whether the 'worker_cpu_affinity' is in nginx.conf .

make init

grep -E "worker_cpu_affinity" conf/nginx.conf > /dev/null
if [ ! $? -eq 0 ]; then
echo "failed: nginx.conf file is missing worker_cpu_affinity configuration"
exit 1
fi

echo "passed: nginx.conf file contains worker_cpu_affinity configuration"

# check admin https enabled

sed -i 's/\# port_admin: 9180/port_admin: 9180/' conf/config.yaml
Expand Down
4 changes: 3 additions & 1 deletion bin/apisix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ local function trim(s)
return (s:gsub("^%s*(.-)%s*$", "%1"))
end

-- Note: The `excute_cmd` return value will have a line break at the end,
-- it is recommended to use the `trim` function to handle the return value.
local function excute_cmd(cmd)
local t, err = io.popen(cmd)
if not t then
Expand Down Expand Up @@ -676,7 +678,7 @@ local function init()
local sys_conf = {
lua_path = pkg_path_org,
lua_cpath = pkg_cpath_org,
os_name = excute_cmd("uname"),
os_name = trim(excute_cmd("uname")),
apisix_lua_home = apisix_home,
with_module_status = with_module_status,
error_log = {level = "warn"},
Expand Down