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.
I modified the URL of this location because when stream_enable is used, test-nginx will occupy the /t URL to initiate stream requests.
|
|
||
| -- 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.
This timer is only applicable in stream mode. Should we check if stream is enabled?
There was a problem hiding this comment.
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