Skip to content

Conversation

diegovb-sys
Copy link
Contributor

Closes #5354

📑 Description

In order to face the race condition. it has been modified the checking strategy after if the value is present.
With the current strategy, a query is built where we include the action in case of conflict, i.e when the lastalert already exists.
Moreover, as this strategy depends on the underlying engine, it has been implemented for 3 engines:

  • SQLite
  • PostreSQL
  • MySQL

About the fails catching, it has been moved to the decorator.

With this modification race conditions should be avoided, when the same alert (tenant+fingerprint) comes in twice.

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

Since the function modified is so called in the principal flow, be careful in its review.

@vercel
Copy link

vercel bot commented Oct 14, 2025

@diegovb-sys is attempting to deploy a commit to the KeepHQ Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. Bug Something isn't working labels Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: Race condition in set_last_alert

1 participant