openresty / openresty/lua-nginx-module

[feature or help] `run_worker_thread` has too strong limitation

Open
#1,919 18 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
11.8k
Forks
2.1k
Avg merge
6h 1m
Merged PRs (30d)
6

Description

As document says, we are not allowed to use any ngx_lua feature in run_worker_thread calls.
I guess it's because thread has no request context to do those calls, but is it really necessary to forbid all ngx.* APIs?

For example:

  1. string manipulate functions, including regex/encode/decode;
  2. nginx enviroment, like ngx.get_phase() config.*
  3. ngx.log()
  4. shared memory ngx.shared

Are those calls allowed but not documented, or for some reason they're not supported, or they can be and will be supported?

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

Start by reviewing the documented restrictions for run_worker_thread and the ngx.* APIs listed in the issue, including ngx.log(), ngx.shared, ngx.get_phase(), and config.*. Determine which APIs lack request context and define the supported behavior or documentation needed for each category.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, lua
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.