janiussyafiq opened a new pull request, #13937:
URL: https://github.com/apache/apisix/pull/13937

   ### Description
   
   `t/xds-library/config_xds_2.t` TEST 4 fails intermittently on loaded runners 
(seen on an EE CI shard on 2026-09-14) with:
   
   ```
   [error] [lua] config_xds.lua:174: decode the conf of [/routes/2] failed, 
err: bad argument #1 to '?' (string expected, got nil), conf_str: nil, context: 
init_worker_by_lua*
   [error] [lua] config_xds.lua:180: invalid conf of [/routes/2], conf: nil, it 
should be an object, context: init_worker_by_lua*
   ```
   
   APISIX runs one worker plus the privileged agent, and both execute the 
blocking startup sync in `config_xds._M.new` during `init_worker`. The worker 
begins serving before the agent finishes that sync. TEST 4 calls 
`ngx.shared["xds-config"]:flush_all()` on the very first line of the request, 
so when it lands during the agent's `get_keys()` / `get()` loop, the keys it 
already listed are expired under it, `get()` returns nil, and the `[error]` 
lines above trip the block's `no_error_log` assertion. The 
`init_worker_by_lua*` context in the log confirms the failing sync is the 
startup one, not the periodic timer.
   
   This PR adds a `ngx.sleep(1.5)` before the flush, the same guard TEST 3 
already uses for its own `flush_all()`.
   
   Verified locally by running the file repeatedly with 24 CPU hogs on an 
11-core box:
   
   | | failures | which test |
   |---|---|---|
   | before | 7/30, then 10/24 | all TEST 4 |
   | after | 0/24 | none |
   
   #### Which issue(s) this PR fixes:
   N/A
   
   ### Checklist
   
   - [x] I have explained the need for this PR and the problem it solves
   - [x] I have explained the changes or the new features added to this PR
   - [x] I have added tests corresponding to this change
   - [ ] I have updated the documentation to reflect this change
   - [x] I have verified that this change is backward compatible (If not, 
please discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)
   


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