Skip to content
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

DM-44541: Remove tokens from Redis if SQL write fails #1042

Merged
merged 1 commit into from
May 24, 2024
Merged

Conversation

rra
Copy link
Member

@rra rra commented May 24, 2024

All token creation paths already created the token in Redis first and then added an entry to SQL, but if the SQL write failed for whatever reason, the Gafaelfawr call would fail but the token would be left behind in Redis. Instead, run the SQL code in a try/except block and try to remove the newly-created Redis key if the SQL write failed. This will hopefully reduce the number of orphaned tokens created during database failures.

All token creation paths already created the token in Redis first
and then added an entry to SQL, but if the SQL write failed for
whatever reason, the Gafaelfawr call would fail but the token would
be left behind in Redis. Instead, run the SQL code in a try/except
block and try to remove the newly-created Redis key if the SQL write
failed. This will hopefully reduce the number of orphaned tokens
created during database failures.
@rra rra enabled auto-merge May 24, 2024 19:50
@rra rra merged commit 94d88b5 into main May 24, 2024
5 checks passed
@rra rra deleted the tickets/DM-44541 branch May 24, 2024 19:52
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.

1 participant