Skip to content

router: fix data race and refactor - #6673

Closed
MakostaDev wants to merge 1 commit into
XTLS:mainfrom
MakostaDev:api-rules
Closed

router: fix data race and refactor#6673
MakostaDev wants to merge 1 commit into
XTLS:mainfrom
MakostaDev:api-rules

Conversation

@MakostaDev

Copy link
Copy Markdown
Contributor

This currently could trigger a data race between gRPC API calls and pickRouteInternal(), as well as in several balancer functions that look up a balancer by tag.

ReloadRules() also had an issue: if it failed partway through, rules and balancers that had already been written stayed in place. I changed it to validate and build the new rules/balancers first, and only swap them in afterward. So on error, the router is left in its original, unchanged state.

A few other functions were also cleaned up for a simpler implementation

@Chara-Freedom

This comment was marked as off-topic.

@Chara-Freedom

This comment was marked as off-topic.

@Fangliding

Fangliding commented Aug 24, 2026

Copy link
Copy Markdown
Member

我重写一份吧 #6678

@Fangliding Fangliding closed this Aug 24, 2026
@MakostaDev
MakostaDev deleted the api-rules branch August 24, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants