Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

body_filter_by_lua breaks APIs in other contexts in anything greater then 1.19 #324

Open
cdloh opened this issue Oct 30, 2024 · 0 comments

Comments

@cdloh
Copy link

cdloh commented Oct 30, 2024

I've logged this as a bug over in the lua-nginx-module repo but incase it's a bug in this code base instead thought I would log it here as well.

openresty/lua-nginx-module#2372


We've been attempting to upgrade some legacy code to a newer version of openresty and hit a road block getting to anything greater then 1.19

We've found an issue that exists in any version greater then openresty 1.19 when using body_filter_by_lua and content_by_lua_block blocks.

I've created a reproduction case here - https://github.com/cdloh/body_filter_by_lua-bug-openresty

I've used lua-resty-http to make making the request easier.

When using both body_filter_by_lua and content_by_lua_block it's impossible to use APIs like ngx.flush(true) if there is any buffering going on. Eventually even if the flush code is only within content_by_lua blocks openresty complains about that API being disabled in body_filter_by_lua phases.

Note that you don't have to be actually doing anything in the body_filter_by_lua block at all. Simply having it defined causes the bug to occur.

You can run the some reproduction repo against 1.19 docker iamges and it work fine, however anything greater and it breaks.

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

No branches or pull requests

1 participant