fix(control): reconcile /v1/plugins/reload like the admin reload path#13745
Open
AlinsRan wants to merge 1 commit into
Open
fix(control): reconcile /v1/plugins/reload like the admin reload path#13745AlinsRan wants to merge 1 commit into
AlinsRan wants to merge 1 commit into
Conversation
apache#13714 made the admin plugins reload converge missed workers by bumping a shared plugins_conf_version and reconciling against it in a periodic timer, but the control API /v1/plugins/reload was left out: it only broadcasts the event. The resty.events broker gives no delivery guarantee while a worker is reconnecting, so a worker can miss the broadcast and stay on stale plugin state even though the API returned 200 -- the same failure apache#13537 described, via the control path. Bump the same shared version from the control path so the existing reconciliation timer converges missed workers too.
AlinsRan
force-pushed
the
fix/control-plugins-reload-reconcile
branch
from
July 24, 2026 09:46
c79504c to
d06facd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to #13714 (which fixed #13537 for the admin reload path).
#13714 made the admin plugins reload (
PUT /apisix/admin/plugins/reload) resilient to theresty.eventsbroker's lack of a delivery guarantee: it bumps a sharedplugins_conf_versioninngx.shared["internal-status"]and a per-worker reconciliation timer reloads any worker whose applied version is behind. That way a worker that misses the broadcast (e.g. while it is reconnecting to the broker) still converges.The control reload path (
PUT /v1/plugins/reload) has the identical exposure but was left out of #13714 —post_reload_plugins()only callsevents:post(). So a worker can miss the control broadcast and keep running the plugins/timers of a removed plugin (exactly the #13537 symptom) even though the API returned200.Note this is not a
lua-resty-eventsbug to fix here — the broker has no replay for a reconnecting client by design; the reconciliation is the intended application-level compensation. This PR simply applies the existing compensation to the control path.Fix
apisix/control/v1.luapost_reload_plugins()now bumps the sameplugins_conf_versionbefore broadcasting, so the reconciliation timer registered by the admin path converges any worker that missed the event. When the admin is disabled the timer is absent and the bump is a no-op, leaving the broadcast as the only path (unchanged).Tests
t/control/plugins-reload-reconcile.t(mirrorst/admin/plugins-reload-reconcile.t):PUT /v1/plugins/reloadbumpsplugins_conf_version.Checklist