-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: corrupt data in routes() response due to healthchecker data #11844
base: master
Are you sure you want to change the base?
fix: corrupt data in routes() response due to healthchecker data #11844
Conversation
…rupt-data-in-route
…sup/apisix into revolyssup/corrupt-data-in-route
we can not update the watched data from etcd, it is dangerous |
The original data is not being modified. It is already deepcopied. But to make it easier to review I have refactored to move the modification logic just below the deepcopy function call so that it's clear that the original data is not being modified. |
if new_route.clean_handlers then | ||
new_route.clean_handlers = {} | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just also set to nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some existing test cases grep logs and expect this to {}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then you can fix the test case as well.
Checking the logs has no meaning for the control api.
Description
Fixes # (issue)
Currently there is an intermittent bug. Below are the steps to reproduce:
Reproduction steps
Checklist
This error is intermittent and multiple tries might be needed to reproduce.
On debugging it was found that the cause of issue was http_router.user_routes table being polluted by adding healthchecks leaving unexpected data which while trying to parse, the error was generated.
As you can see in the generated logs, user_route returned healthchecker data.
Fix
Remove healthcheck related objects before sending to user.