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 sweepLogs abort functionality #9195

Merged
merged 7 commits into from
Sep 24, 2024
Merged

fix sweepLogs abort functionality #9195

merged 7 commits into from
Sep 24, 2024

Conversation

fungairino
Copy link
Collaborator

@fungairino fungairino commented Sep 23, 2024

What does this PR do?

  • Fixes a bug with the abort timeout in the sweepLogs function where it was not being executed due to improper this scope.
  • See this datadog trace
  • Tested by manually introducing an infinite loop in the sweeplogs and verifying it is aborted

Checklist

  • Added jest or playwright tests and/or storybook stories

For more information on our expectations for the PR process, see the
code review principles doc

Copy link

codecov bot commented Sep 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.82%. Comparing base (8318d74) to head (4071cf0).
Report is 315 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

const abortController = new AbortController();
setTimeout(() => {
abortController.abort();
}, 10_000);
Copy link
Collaborator Author

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

Copy link
Contributor

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?

Copy link
Collaborator Author

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.

Copy link

github-actions bot commented Sep 23, 2024

Playwright test results

passed  130 passed
flaky  4 flaky
skipped  4 skipped

Details

report  Open report ↗︎
stats  138 tests across 45 suites
duration  12 minutes, 33 seconds
commit  4071cf0
info  For more information on how to debug and view this report, see our readme

Flaky tests

chrome › tests/pageEditor/addStarterBrick.spec.ts › Add starter brick to mod
msedge › tests/pageEditor/addStarterBrick.spec.ts › Add starter brick to mod
msedge › tests/pageEditor/copyMod.spec.ts › run a copied mod with a built-in integration
msedge › tests/runtime/sidebar/sidebarNavigation.spec.ts › sidebar mod panels are persistent during navigation

Skipped tests

chrome › tests/regressions/doNotCloseSidebarOnPageEditorSave.spec.ts › #8104: Do not automatically close the sidebar when saving in the Page Editor
msedge › tests/regressions/doNotCloseSidebarOnPageEditorSave.spec.ts › #8104: Do not automatically close the sidebar when saving in the Page Editor
chrome › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options
msedge › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options

@twschiller twschiller added this to the 2.1.3 milestone Sep 24, 2024
Copy link

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.

@fungairino fungairino merged commit 73c5eb5 into main Sep 24, 2024
23 checks passed
@fungairino fungairino deleted the sweep-logs-abort-bug branch September 24, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

3 participants