Skip to content

Conversation

nic-6443
Copy link
Member

@nic-6443 nic-6443 commented Sep 9, 2025

Description

Which issue(s) this PR fixes:

Fixes #12556

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@nic-6443 nic-6443 changed the title fix(standalone): support stream_route in admin api mode fix(standalone): support stream route in admin api mode Sep 9, 2025
=== TEST 3: get config
--- config
location /t {
location /config {
Copy link
Member Author

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.

@nic-6443 nic-6443 marked this pull request as ready for review September 10, 2025 01:05
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Sep 10, 2025

-- 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()
Copy link
Contributor

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?

Copy link
Member Author

@nic-6443 nic-6443 Sep 10, 2025

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

AlinsRan
AlinsRan previously approved these changes Sep 10, 2025
@nic-6443 nic-6443 requested a review from bzp2010 September 11, 2025 08:31
Signed-off-by: Nic <[email protected]>
@Revolyssup Revolyssup merged commit a1e2fa8 into apache:master Sep 16, 2025
40 of 42 checks passed
@nic-6443 nic-6443 deleted the nic/stream-route-standalone branch September 16, 2025 06:01
jizhuozhi pushed a commit to jizhuozhi/apisix that referenced this pull request Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: stream routes in the standalone API cannot be loaded correctly

4 participants