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: unnecessary replay runs update #300

Merged
merged 7 commits into from
Nov 15, 2024

Conversation

arinda-arif
Copy link

@arinda-arif arinda-arif commented Nov 11, 2024

Reduce update calls to DB for replay cases:

  • Avoid updating every replay run in each loop
    • Avoid updating runs at the start of the loop. Instead, Optimus will only update the runs at the end of each loop.
    • Before doing an update, the replay worker will fetch the list of differed runs and will only update those. By this, the updated_at value of each run will be valid, based on when it is actually finished.
  • Avoid checking whether the replay is canceled or not before executing. A similar check was done at the start of the loop. This is also safe to do as if the execution is proceeded (due to race conditions), the status will not be updated to in_progress.

Copy link
Member

@Mryashbhardwaj Mryashbhardwaj left a comment

Choose a reason for hiding this comment

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

just need one small optimisation , rest all is perfect

@arinda-arif arinda-arif merged commit 33cdee2 into main Nov 15, 2024
3 checks passed
@arinda-arif arinda-arif deleted the fix-unnecessary-replay-run-update branch November 15, 2024 09:20
arinda-arif added a commit that referenced this pull request Nov 15, 2024
* fix: unnecessary replay runs update

* refactor: remove unused code in replay

* fix: unmatch replay status when fetching different run list

* fix: add cancel check before continue replay execution

* refactor: add check for runs length before updating the final runs

* test: fix invalid test in replay worker
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.

2 participants