fix: Heap usage request throttling#1450
Merged
mofojed merged 8 commits intodeephaven:mainfrom Aug 25, 2023
Merged
Conversation
c115118 to
c62babd
Compare
8c34703 to
96e4cb7
Compare
Codecov Report
@@ Coverage Diff @@
## main #1450 +/- ##
==========================================
+ Coverage 45.70% 45.75% +0.05%
==========================================
Files 513 515 +2
Lines 35046 35073 +27
Branches 8781 8784 +3
==========================================
+ Hits 16017 16048 +31
+ Misses 18978 18974 -4
Partials 51 51
Flags with carried forward coverage won't be shown. Click here to find out more.
|
mofojed
requested changes
Aug 24, 2023
| 'ms elapsed since last tick.' | ||
| ); | ||
|
|
||
| await callback(); |
Member
There was a problem hiding this comment.
If the component unmounts during this callback, I think the timer will continue on - it returns from this callback, and there's nothing to stop it from calling window.setTimeout at the end.
Should set an isCancelled ref when unmounted, or you could overload the setTimeoutRef instead.
mofojed
requested changes
Aug 24, 2023
mofojed
approved these changes
Aug 25, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #1439 - Heap usage code now guarantees that new requests won't be scheduled until all previous requests are complete.
Testing
I tested by shutting my Mac for ~2 hours and returning. Timings looks something like this:
Summary
It seems that requests still happen occasionally while sleeping. On Wake up, there were a few ticks resulting in "Unable to get heap usage" console errors. Then a prompt showed up indicating credentials had expired at which point requests start succeeding again.
Full Console Log