Skip to content

Conversation

@Baoyuantop
Copy link
Contributor

@Baoyuantop Baoyuantop commented Nov 24, 2025

Description

Configuring Consul service discovery in APISIX and restarting it while APISIX is continuously receiving traffic will result in frequent 503 errors.

In the design of Consul service discovery, only worker 0 directly pulls nodes from Consul and updates data. Other workers rely on events:register to receive broadcasts. If, when APISIX restarts, any worker has not yet completed events:register, but the service list data broadcast has already been sent, these workers will miss receiving data, and requests sent to that worker will return a 503 error.

This problem can be avoided by changing the event module to shared dict.

Which issue(s) this PR fixes:

Fixes #12398

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)

@Baoyuantop Baoyuantop changed the title fix: change consul event to shared dict fix: change consul event module to shared dict Nov 24, 2025
@Baoyuantop Baoyuantop marked this pull request as ready for review December 4, 2025 07:45
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Dec 4, 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: 503 errors occur after restarting APISIX when using Consul and APISIX both in Docker

1 participant