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

fix(application-generic): handle lock acquisition conflicts #6733

Merged
merged 2 commits into from
Oct 21, 2024

Conversation

rifont
Copy link
Collaborator

@rifont rifont commented Oct 21, 2024

What changed? Why was the change needed?

  • Throw a 409 Conflict Error when a cache lock cannot be acquired. 409 is commonly understood to be a retryable 4xx error, so this change is semantic.

Screenshots

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

throw new Error(`Failed to acquire lock for key: ${cacheKey}`);
throw new ConflictException(
`Failed to acquire cache lock. Please try again later.`,
);
Copy link
Collaborator Author

@rifont rifont Oct 21, 2024

Choose a reason for hiding this comment

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

It was a mistake to include cacheKey in the log as it can expose server implementation details. We just return a simple error message. Note, it's still not ideal that cache issues should throw a client error.

Copy link
Contributor

@SokratisVidros SokratisVidros left a comment

Choose a reason for hiding this comment

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

Lovely!

@rifont rifont merged commit 3314c47 into next Oct 21, 2024
29 checks passed
@rifont rifont deleted the fix-lock-acquisition-error branch October 21, 2024 13:00
Copy link

netlify bot commented Oct 21, 2024

Deploy Preview for novu-stg-vite-dashboard-poc ready!

Name Link
🔨 Latest commit eaad7c0
🔍 Latest deploy log https://app.netlify.com/sites/novu-stg-vite-dashboard-poc/deploys/671642d84d878800077f6d7c
😎 Deploy Preview https://deploy-preview-6733--novu-stg-vite-dashboard-poc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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.

3 participants