nic-6443 commented on issue #10069:
URL: https://github.com/apache/apisix/issues/10069#issuecomment-4676892222

   This turned out to be a bug in lua-nginx-module itself rather than in the 
APISIX plugin code, and it's fixed in current releases. ext-plugin-post-resp 
streams the upstream response with ngx.print/ngx.flush from the access phase; 
when the response is large enough that output backs up, the pending-output 
flush re-enters the body filter with a NULL chain, and 
`ngx_http_lua_body_filter` failed to restore its phase context — so the next 
ngx.print aborted with "API disabled in the context of body_filter_by_lua*" and 
the response got truncated. That's why only large (~100KB+) bodies were 
affected, and why `response.setBody(request.getBody())` happened to dodge it.
   
   It was reported upstream as openresty/lua-nginx-module#2410 and fixed in 
#2411; APISIX picked it up via the apisix-nginx-module patch 
(api7/apisix-nginx-module#104), which is in apisix-runtime 1.3.1+, i.e. 
official builds of APISIX 3.13.0 and later. Upgrading to >= 3.13.0 should make 
the workaround unnecessary, so I think this one can be closed.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to