AlinsRan commented on PR #13886:
URL: https://github.com/apache/apisix/pull/13886#issuecomment-5474867129

   Added in 67f214c, in `t/cli/test_standalone_plugin_reload.sh` (required CI, 
real gateway process).
   
   **Making a worker version-behind deterministically.** The broadcast path 
could not exercise the timer because the event is always delivered. A route 
running `serverless-pre-function` advances the shared version the way a reload 
does, but posts no event:
   
   ```
   GET /bump -> ngx.shared["internal-status"]:incr("plugins_conf_version", 1, 0)
   ```
   
   That is exactly the state a worker that lost the broadcast is left in, and 
the shared dict is shared, so every worker is left behind at once. Only the 
reconciliation timer can converge them.
   
   **What is asserted**, in both directions, with deadline-bounded polling:
   
   - proxied status: 401 (key-auth loaded) <-> 502 (unloaded, request reaches 
the proxy)
   - module state, not just the per-route plugin lookup: `node-status`'s api 
route behind `public-api`. `api_router` is an lrucache keyed on 
`plugin_mod.load_times`, so it only changes if `plugin.load()` actually ran
   - no stale timer after unload: `error-log-logger` registers 
`plugin#error-log-logger` with the background timer, which logs `run 
timer[...]` once a second at info. After the unload the test records the log 
offset, waits past several intervals, and requires zero new lines; the reverse 
transition requires them to resume
   
   **It fails without the fix.** Restoring the `and not 
is_yaml_config_provider` gate:
   
   ```
   passed: the plugin api route and the plugin timer are both live
   failed: the reconciliation timer should unload key-auth without an event 
(last status: 401)
   ```
   
   Verified locally end to end on both this branch and the downstream port. 
`prometheus` is in both plugin lists on purpose: the `prometheus-cache` shared 
dict is only rendered when it is enabled at init time, and `error-log-logger` 
reaches the exporter through its require chain.


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