-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
pkg/rules/proxy: fix hotlooping when receiving client errors #3732
Conversation
f30a4e3
to
5b9c955
Compare
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.
looks great @s-urbaniak :)
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.
LGTM!
@squat Does it makes sense to get this fix released with |
yes, it very much could make sense. In this case, @s-urbaniak, I would ask that you make the pr against the release-0.18 branch instead. We would later merge this into main. |
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.
Amazing, let's do same on release-0.18
?
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 extra tips
Currently, if we receive an error from the underlying client stream, we continue with trying to receive additional data. This causes a hotloop as we will receive the same error again. This fixes it by returning in the error case and adds a unit test for the proxy logic. Fixes thanos-io#3717 Signed-off-by: Sergiusz Urbaniak <[email protected]>
@bwplotka thank you for the review! 💚 PTAL for final review :) |
Submitted #3734 for the 0.18 backport. |
Mmm rather than doing this in both branches, we should do what we always do which is merge in the release branch and then merge the release branch into the master branch no? If we all agree then I'll close this PR |
leaving up to the maintainers, i have both PRs open :-) |
@squat Yeah let's close this and merge the PR in release branch. I don't think we will get a conflict but let's avoid polluting the git history with duplicate changes. |
Currently, if we receive an error from the underlying client stream,
we continue with trying to receive additional data.
This causes a hotloop as we will receive the same error again.
This fixes it by returning in the error case and adds a unit test for the proxy logic.
Fixes #3717
Signed-off-by: Sergiusz Urbaniak [email protected]
Changes
Verification
Added unit tests, without the fix the unit test will hotloop.
cc @bwplotka @kakkoyun @squat