fix: corrupt data in routes() response due to healthchecker data#11844
Merged
Revolyssup merged 16 commits intoDec 27, 2024
Conversation
Revolyssup
marked this pull request as draft
December 20, 2024 08:06
Revolyssup
marked this pull request as ready for review
December 22, 2024 17:33
…rupt-data-in-route
…sup/apisix into revolyssup/corrupt-data-in-route
Member
|
we can not update the watched data from etcd, it is dangerous |
Contributor
Author
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. |
membphis
reviewed
Dec 24, 2024
nic-chen
reviewed
Dec 24, 2024
Comment on lines
+276
to
+278
| if new_route.clean_handlers then | ||
| new_route.clean_handlers = {} | ||
| end |
Contributor
Author
There was a problem hiding this comment.
some existing test cases grep logs and expect this to {}
Member
There was a problem hiding this comment.
Then you can fix the test case as well.
Checking the logs has no meaning for the control api.
nic-6443
reviewed
Dec 25, 2024
nic-chen
reviewed
Dec 26, 2024
nic-chen
left a comment
Member
There was a problem hiding this comment.
please add test cases to ensure error is gone
Contributor
Author
added |
nic-chen
approved these changes
Dec 26, 2024
shreemaan-abhishek
approved these changes
Dec 26, 2024
nic-6443
approved these changes
Dec 27, 2024
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.