Skip to content

Conversation

@wisonzhu
Copy link

@wisonzhu wisonzhu commented Oct 23, 2025

Fixes #12610

Description

Which issue(s) this PR fixes:

Fixes #

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)

解决eureka任意节点故障后执行reload会丢失一半请求 apache#12610
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Oct 23, 2025
@wisonzhu wisonzhu changed the title Update init.lua 解决eureka任意节点故障后执行reload会丢失一半请求 Oct 23, 2025
@Revolyssup Revolyssup changed the title 解决eureka任意节点故障后执行reload会丢失一半请求 bug: reloading after any node failure in eureka will lose half of the requests Oct 23, 2025
@Revolyssup Revolyssup changed the title bug: reloading after any node failure in eureka will lose half of the requests fix: reloading after any node failure in eureka will lose half of the requests Oct 23, 2025
reloading after any node failure in eureka will lose half of the requests
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Oct 24, 2025
@wisonzhu wisonzhu requested a review from Revolyssup October 27, 2025 02:22
metadata = metadata,
})
if metadata then
-- remove useless data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this?

end

local json_str = res.body
local data, err = core.json.decode(json_str)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change necessary?

Comment on lines +36 to +37
local init_sema
local initial_fetched = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain some of the functions of this?


local request_uri, basic_auth = service_info()
if not request_uri then
local endpoints = build_endpoints()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to execute build_endpoints directly during the init_worker phase.

@Baoyuantop
Copy link
Contributor

Hi @wisonzhu, thanks for your contribution. I left some comments.

@Baoyuantop
Copy link
Contributor

Hi @wisonzhu, any updates?

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:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: dynamic upstream, one Eureka node is unavailable, half of the requests are lost after reloading

3 participants