openresty / openresty/lua-resty-core

openresty/1.15.8.1 ngx.proecss doesn't support stream

Open
#279 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
853
Forks
286
Avg merge
35m
Merged PRs (30d)
1

Description

Lua code:

local process = require "ngx.process"
process.signal_graceful_exit()

Nginx config:

stream {
    log_format basic '$remote_addr [$time_local] '
        '$protocol $status $bytes_sent $bytes_received '
        '$session_time $upstream_addr $upstream_first_byte_time';
    access_log logs/access.log basic;

    resolver 8.8.8.8;

    lua_shared_dict servers 1M;
    lua_shared_dict stats 1M;
    lua_package_path "/usr/local/openresty/nginx/app/?.lua;;";
    init_worker_by_lua_file app/init.lua;

    upstream backend {
        server 0.0.0.1:1234;
        balancer_by_lua_file app/balancer.lua;
    }

    server {
        listen       443;
        proxy_pass backend;
        proxy_connect_timeout 5s;
        log_by_lua_file app/stats.lua;
    }

    server {
        listen       445;
        content_by_lua_file app/content.lua;
    }
}

Error log:

2019/10/03 14:44:25 [error] 32426#32426: init_worker_by_lua_file error: /usr/local/openresty/lualib/ngx/process.lua:5: unsupported subsystem: stream
stack traceback:
	[C]: in function 'error'
	/usr/local/openresty/lualib/resty/core/base.lua:222: in function 'allows_subsystem'
	/usr/local/openresty/lualib/ngx/process.lua:5: in main chunk
	[C]: in function 'require'
	/usr/local/openresty/nginx/app/panel.lua:4: in main chunk
	[C]: in function 'require'
	/usr/local/openresty/nginx/app/init.lua:1: in main chunk

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with ngx/process.lua and the allows_subsystem check in resty/core/base.lua, using the stream configuration and init_worker_by_lua_file reproduction as the entry point. Confirm the intended subsystem support and verify that requiring ngx.process and calling signal_graceful_exit in stream no longer produces the unsupported subsystem error.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, nginx
Domain
backend, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.