Skip to content

bugfix: send the HUP mode signals from perl instead of running kill(1). - #190

Merged
zhuizhuhaomeng merged 1 commit into
openresty:masterfrom
oowl:bugfix/hup-signal-without-kill
Oct 27, 2026
Merged

zhuizhuhaomeng merged 1 commit into
openresty:masterfrom
oowl:bugfix/hup-signal-without-kill

Conversation

@oowl

@oowl oowl commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Related PRs

PR What it does
openresty/lua-nginx-module#2536 C side: pool_size in the balancer keepalive FFI API, per-pool descriptors
openresty/lua-resty-core#544 Lua side: balancer.enable_keepalive(idle_timeout?, max_requests?, pool_size?)
#190 Fixes the ASan CI hang in HUP tests on Ubuntu 22.04. Independent of the feature

Suggested merge order:

  1. bugfix: send the HUP mode signals from perl instead of running kill(1). #190, then drop the TEMPORARY CI commit from feature: added the pool_size argument to the balancer keepalive FFI API. lua-nginx-module#2536.
  2. feature: added the pool_size argument to the balancer keepalive FFI API. lua-nginx-module#2536 together with feature: ngx.balancer: added the pool_size argument to enable_keepalive(). lua-resty-core#544 (the FFI signature changes). Drop the TEMPORARY CI commit from feature: ngx.balancer: added the pool_size argument to enable_keepalive(). lua-resty-core#544 once #2536 is on master.

Problem

With TEST_NGINX_USE_HUP, Test::Nginx::Util reloads nginx with system("kill -USR1 $pid") and system("kill -HUP $pid"). The kill(1) child inherits the test environment, including LD_PRELOAD.

On Ubuntu 22.04, procps' kill (and ps) deadlock at startup in a futex wait when gcc 11's libasan.so is in LD_PRELOAD. lua-nginx-module's ASan CI job preloads it, so the first HUP test file (t/078-hup-vars.t) hangs the job until the 6 hour limit. This has happened since that CI moved to ubuntu-22.04. Example on master: https://github.com/openresty/lua-nginx-module/actions/runs/39918204085

How I narrowed it down on an ubuntu-22.04 runner with the ASan job's LD_PRELOAD:

program result
/usr/bin/kill -0 $$, /bin/kill -0 $$, ps -p $$ hang (stuck in futex_wait_queue)
/bin/true, sh -c true, env true, perl -e 1 fine

At the time of the hang, nginx itself is healthy: the master is in sigsuspend and the worker in epoll_wait. Only the kill child is stuck.

Change

  • Send USR1 and HUP with perl's kill(). No child process is involved, and the success check is unchanged.
  • Drop LD_PRELOAD (delete local $ENV{LD_PRELOAD}) for the pgrep | xargs ps pipeline that waits for HTTP/3 connections. It runs the same procps tools.

Testing

With TEST_NGINX_USE_HUP, the USR1 and HUP signals were sent with
system("kill ..."). The kill(1) child inherits the environment of the
test run, including LD_PRELOAD. On Ubuntu 22.04, procps' kill and ps
deadlock at startup (futex wait) when gcc 11's libasan is preloaded, as
lua-nginx-module's ASan CI job does, so the first HUP test hung the job
until the 6 hour limit.

Send the signals with perl's kill() instead, and drop LD_PRELOAD for
the pgrep/ps pipeline used to wait for HTTP/3 connections.
Copilot AI balanced review requested due to automatic review settings October 25, 2026 16:26
oowl added a commit to oowl/lua-nginx-module that referenced this pull request Oct 25, 2026
The ASan job hangs in the first TEST_NGINX_USE_HUP test since CI moved to
Ubuntu 22.04: Test::Nginx sends USR1/HUP with system("kill ..."), and
procps' kill deadlocks at startup under the job's LD_PRELOAD (gcc 11
libasan). Master's own ASan job hangs the same way. Point CI at the
branch of openresty/test-nginx#190, which signals from perl instead.
Drop this commit once that PR is merged.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

oowl added a commit to oowl/lua-nginx-module that referenced this pull request Oct 25, 2026
The ASan job hangs in the first TEST_NGINX_USE_HUP test since CI moved to
Ubuntu 22.04: Test::Nginx sends USR1/HUP with system("kill ..."), and
procps' kill deadlocks at startup under the job's LD_PRELOAD (gcc 11
libasan). Master's own ASan job hangs the same way. Point CI at the
branch of openresty/test-nginx#190, which signals from perl instead.
Drop this commit once that PR is merged.
@zhuizhuhaomeng
zhuizhuhaomeng merged commit e368857 into openresty:master Oct 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants