-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fix(standalone): support stream route in admin api mode #12604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(standalone): support stream route in admin api mode #12604
Conversation
Signed-off-by: Nic <[email protected]>
=== TEST 3: get config | ||
--- config | ||
location /t { | ||
location /config { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I modified the URL of this location because when stream_enable
is used, test-nginx will occupy the /t
URL to initiate stream requests.
apisix/admin/standalone.lua
Outdated
|
||
-- due to the event module can not broadcast events between http and stream subsystems, | ||
-- we need to poll the shared dict to keep the config in sync | ||
local last_sync_time = ngx_time() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This timer is only applicable in stream mode. Should we check if stream is enabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ref from #12556
To address this issue and further ensure the reliability of the event notification mechanism, I believe we should introduce a background timer loop. This would allow the configuration refresh mechanism to passively take effect even if event broadcasting fails.
Since we check METADATA_LAST_MODIFIED
and last_sync_time
first, this timer is lightweight. I think we can run it in the HTTP subsystem too, ensuring config sync even if event broadcasting fails (not only for stream subsystem).
Signed-off-by: Nic <[email protected]>
Description
Which issue(s) this PR fixes:
Fixes #12556
Checklist