Skip to content

Commit c2b6402

Browse files
committed
Attempt to stabilize test suite against older OpenResty versions.
1 parent ba0b9fa commit c2b6402

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/resty/auto-ssl/utils/start_sockproc.lua

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ local auto_ssl = require "resty.auto-ssl"
22
local lock = require "resty.lock"
33
local shell_blocking = require "shell-games"
44

5+
local run = shell_blocking.capture_combined
6+
-- Don't capture output in older OpenResty versions prior to SIGCHLD handling
7+
-- being fixed: https://github.com/openresty/lua-nginx-module/pull/1296
8+
-- While this still seems to work, it can cause sporadic, but hard to reproduce
9+
-- errors (that don't affect behavior) in the test suite against older
10+
-- OpenResty versions.
11+
if ngx.config.ngx_lua_version < 10014 then
12+
run = shell_blocking.run
13+
end
14+
515
local function start()
616
local _, set_false_err = ngx.shared.auto_ssl_settings:safe_set("sockproc_started", false)
717
if set_false_err then
@@ -10,7 +20,7 @@ local function start()
1020

1121
ngx.log(ngx.NOTICE, "auto-ssl: starting sockproc")
1222

13-
local _, run_err = shell_blocking.capture_combined({ auto_ssl.lua_root .. "/bin/resty-auto-ssl/start_sockproc" }, { umask = "0022" })
23+
local _, run_err = run({ auto_ssl.lua_root .. "/bin/resty-auto-ssl/start_sockproc" }, { umask = "0022" })
1424
if run_err then
1525
ngx.log(ngx.ERR, "auto-ssl: failed to start sockproc: ", run_err)
1626
else

0 commit comments

Comments
 (0)