shreemaan-abhishek commented on PR #13778:
URL: https://github.com/apache/apisix/pull/13778#issuecomment-5190573841

   Pushed the config change: `plugin_attr.ai-proxy.http_client` now takes one 
of the two client names and defaults to the C client.
   
   ```yaml
   plugin_attr:
     ai-proxy:
       http_client: ngx_http_ffi_client # or lua-resty-http
   ```
   
   `auto` and `ffi` are gone. `auto` made the choice implicit in whatever the 
runtime happened to carry, which is the opposite of what a config knob is for.
   
   **Coverage of the `lua-resty-http` path.** TEST 10 selects it through 
`plugin_attr` and asserts the request goes through the Lua client, but it does 
that against a stub. TEST 11 is new and drives the real thing: `http_client: 
lua-resty-http`, nothing stubbed, a real request to a local upstream, asserting 
status, `Content-Type`, body and `set_keepalive`.
   
   **One decision worth a look.** With no `auto`, a runtime built without the 
module and left on the default has to do something. I kept the fallback to 
`lua-resty-http` and log it, rather than failing the request, because until a 
released runtime carries the module that is every deployment, and failing would 
turn this into a breaking change. The log stays at warn rather than error for 
the same reason: at error level every AI request on such a runtime writes an 
error line, and it broke the `no_error_log: [error]` blocks in the existing 
suite when I tried it.
   
   If you would rather the default hard-fail when the module is missing, that 
is a small change, but it means these two PRs cannot merge before a runtime 
carrying the module ships.


-- 
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