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: Share a single database sessions starting from __handle_formatted_events to RuleEngine #2053

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

VladimirFilonov
Copy link
Contributor

@VladimirFilonov VladimirFilonov commented Sep 30, 2024

Closes #2052

📑 Description

Problem: sometimes, we experience deadlocks during the RuleEngine.run_rules execution

image

I assume that we are using multiple database sessions in various functions, which are called inside run_rules.

In this PR, I'm adding the possibility of passing an existing session to downstream functions to prevent such race conditions.

✅ 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

Copy link

vercel bot commented Sep 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
keep ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 1, 2024 0:28am

@VladimirFilonov VladimirFilonov force-pushed the fix/2052-rules-session-race-conditions branch from 38fb8b6 to f5b5059 Compare September 30, 2024 15:32
@VladimirFilonov VladimirFilonov force-pushed the fix/2052-rules-session-race-conditions branch from f5b5059 to b224156 Compare September 30, 2024 16:22
@shahargl shahargl self-requested a review October 1, 2024 12:20
Copy link
Member

@shahargl shahargl left a comment

Choose a reason for hiding this comment

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

#yolo

@VladimirFilonov VladimirFilonov enabled auto-merge (squash) October 1, 2024 12:25
@VladimirFilonov VladimirFilonov merged commit b3669f1 into main Oct 1, 2024
9 of 11 checks passed
@VladimirFilonov VladimirFilonov deleted the fix/2052-rules-session-race-conditions branch October 1, 2024 12:28
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.

[🐛 Bug]: RulesEngine.run_rules can have race-conditions in sessions which leads to deadlocks
2 participants