-
Notifications
You must be signed in to change notification settings - Fork 23
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 sweepLogs abort functionality #9195
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9195 +/- ##
==========================================
+ Coverage 74.24% 74.82% +0.57%
==========================================
Files 1332 1364 +32
Lines 40817 42041 +1224
Branches 7634 7850 +216
==========================================
+ Hits 30306 31458 +1152
- Misses 10511 10583 +72 ☔ View full report in Codecov by Sentry. |
const abortController = new AbortController(); | ||
setTimeout(() => { | ||
abortController.abort(); | ||
}, 10_000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reduced it to 10s in testing, but I'm not sure what is the right amount of time to wait for the sweeper to be done. It seems like it can delete entries pretty quickly though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: probably doesn't matter, but do we want to clear the timeout if the sweep finishes before the timer?
Looking at this code, this blocks other writes to the DB for 10 seconds. Should we be splitting it into smaller transaction batches to avoid blocking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered clearing the timeout, but it doesn't matter - all it does is turn on the AbortController which will do nothing if the loop already finished.
Splitting the transaction into smaller batches is a good idea though, and seems like it might be easy to do.
Playwright test resultsDetails Open report ↗︎ Flaky testschrome › tests/pageEditor/addStarterBrick.spec.ts › Add starter brick to mod Skipped testschrome › tests/regressions/doNotCloseSidebarOnPageEditorSave.spec.ts › #8104: Do not automatically close the sidebar when saving in the Page Editor |
No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack. Do not edit this comment manually. |
What does this PR do?
this
scope.Checklist
For more information on our expectations for the PR process, see the
code review principles doc