Modified the Monitor InformationFetcher class to purge stale data#6433
Open
dlmarion wants to merge 4 commits into
Open
Modified the Monitor InformationFetcher class to purge stale data#6433dlmarion wants to merge 4 commits into
dlmarion wants to merge 4 commits into
Conversation
DomGarguilo
reviewed
Jun 18, 2026
DomGarguilo
reviewed
Jun 18, 2026
Comment on lines
+796
to
+797
| final int clearStateMins = 10; | ||
| final Duration clearStateDuration = Duration.ofMinutes(clearStateMins); |
Member
There was a problem hiding this comment.
Suggested change
| final int clearStateMins = 10; | |
| final Duration clearStateDuration = Duration.ofMinutes(clearStateMins); | |
| final Duration clearStateDuration = Duration.ofMinutes(10); |
Doesn't look like clearStateMins is used elsewhere (except in a comment where we could use clearStateDuration.toMinutes() instead). could just remove it.
Contributor
Author
There was a problem hiding this comment.
I'm going to leave as-is for now. I'm wondering if this value might be more useful as a property.
| } | ||
| // If a connection has not been made in 5 minutes, | ||
| // then clear the summaryRef so that stale data is not displayed. | ||
| if (this.summaryRef.get() != null && noConnectionTimer.hasElapsed(clearStateDuration)) { |
Member
There was a problem hiding this comment.
Suggested change
| if (this.summaryRef.get() != null && noConnectionTimer.hasElapsed(clearStateDuration)) { | |
| if (noConnectionTimer.hasElapsed(clearStateDuration)) { |
The code below returns the actual previous value anyways and oldSummary != null handles whether to clear or not already.
Contributor
Author
There was a problem hiding this comment.
With the check there we will only enter the code block once, instead of every clearStateDuration minutes.
Co-authored-by: Dom G. <domgarguilo@apache.org>
DomGarguilo
approved these changes
Jun 18, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #6390