You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "Baoyuantop (via GitHub)" <gi...@apache.org> on 2026/04/14 05:15:31 UTC

Re: [I] bug: ai-proxy-multi health checker creation always fails in timer context due to missing _dns_value [apisix]

Baoyuantop commented on issue #13101:
URL: https://github.com/apache/apisix/issues/13101#issuecomment-4241444801

   ### Reproduction Verified on APISIX 3.16.0
   
   Bug confirmed on **APISIX 3.16.0-debian** (latest release).
   
   #### Environment
   - Image: `apache/apisix:3.16.0-debian`
   - etcd: `bitnamilegacy/etcd:3.5`
   - Docker Compose with custom backends
   
   #### Reproduction Steps
   1. Create a route with `ai-proxy-multi` + `checks` (active health check enabled)
   2. Send a request to trigger health checker creation → checkers created successfully
   3. Update the route via Admin API (`PATCH` with any change like adding `desc`)
   4. Observe error logs: `timer_working_pool_check` crashes every second
   
   #### Error Output
   ```
   [error] healthcheck_manager.lua:288: failed to run timer_working_pool_check:
     /usr/local/apisix/apisix/healthcheck_manager.lua:238:
     attempt to index local 'upstream' (a nil value), context: ngx.timer
   ```
   
   The crash repeats every second indefinitely (5 crashes in 5 seconds observed).
   
   #### Root Cause
   When the route config is updated via Admin API, etcd watch triggers a config cache refresh with a new in-memory Lua table object. This new object does NOT have the `_dns_value` runtime field (which was set by `resolve_endpoint` only during request processing on the previous object). `construct_upstream` returns `nil`, and the subsequent `upstream.resource_key` indexing crashes.
   
   #### Key Observation
   The initial health checker creation succeeds because the request thread sets `_dns_value` on the shared config cache object before the timer fires. The bug only manifests after a config update refreshes the cache with a clean object.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org