Skip to content

integrations/access: fix infinite retry on already resolved requests#29367

Merged
hugoShaka merged 4 commits intomasterfrom
hugo/p871-fix-stuck-slack-plugin
Aug 9, 2023
Merged

integrations/access: fix infinite retry on already resolved requests#29367
hugoShaka merged 4 commits intomasterfrom
hugo/p871-fix-stuck-slack-plugin

Conversation

@hugoShaka
Copy link
Copy Markdown
Contributor

Fixes gravitational/teleport-plugins#871

The Compare-and-Swap (CaS) modification logic was returning CompareFailedErr when 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.

@hugoShaka hugoShaka marked this pull request as ready for review July 20, 2023 17:29
@hugoShaka hugoShaka requested a review from r0mant July 20, 2023 17:43
Copy link
Copy Markdown
Contributor

@marcoandredinis marcoandredinis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to add test coverage here

@hugoShaka
Copy link
Copy Markdown
Contributor Author

It would be good to add test coverage here

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).

@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from ravicious July 20, 2023 17:58
@hugoShaka
Copy link
Copy Markdown
Contributor Author

Note: this PR is waiting for customer feedback to know if this solves their issue.

@hugoShaka hugoShaka enabled auto-merge August 8, 2023 20:57
@hugoShaka hugoShaka added this pull request to the merge queue Aug 9, 2023
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 9, 2023
@hugoShaka hugoShaka enabled auto-merge August 9, 2023 18:05
@hugoShaka hugoShaka added this pull request to the merge queue Aug 9, 2023
Merged via the queue into master with commit 34e1565 Aug 9, 2023
@hugoShaka hugoShaka deleted the hugo/p871-fix-stuck-slack-plugin branch August 9, 2023 18:35
@public-teleport-github-review-bot
Copy link
Copy Markdown

@hugoShaka See the table below for backport results.

Branch Result
branch/v12 Create PR
branch/v13 Create PR

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.

Slack Plugin Errors with Interrupted Workflow

3 participants