integrations/access: fix infinite retry on already resolved requests#29367
Merged
integrations/access: fix infinite retry on already resolved requests#29367
Conversation
marcoandredinis
approved these changes
Jul 20, 2023
Contributor
marcoandredinis
left a comment
There was a problem hiding this comment.
It would be good to add test coverage here
Contributor
Author
I agree, but I can't find a way to do it. We need to spin up all dependencies like an integration test, reach a state that is technically invalid, and observe the kind of error that is returned (there's no measurable output in both cases). |
r0mant
approved these changes
Jul 20, 2023
Contributor
Author
|
Note: this PR is waiting for customer feedback to know if this solves their issue. |
|
@hugoShaka See the table below for backport results.
|
This was referenced Aug 9, 2023
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.
Fixes gravitational/teleport-plugins#871
The Compare-and-Swap (CaS) modification logic was returning
CompareFailedErrwhen the request was already resolved. This instructed the CaS to retry. As we can't get out of this scenario by retrying, the plugin ended up looping on the event and spamming teleport.This PR changes the behaviour of the generic access app to either silently ignore duplicated event, but still throw errors if the event received is not consistent with the current access request plugin data.