Skip to content

Modified the Monitor InformationFetcher class to purge stale data#6433

Open
dlmarion wants to merge 4 commits into
apache:mainfrom
dlmarion:6390-monitor-stale-data
Open

Modified the Monitor InformationFetcher class to purge stale data#6433
dlmarion wants to merge 4 commits into
apache:mainfrom
dlmarion:6390-monitor-stale-data

Conversation

@dlmarion

Copy link
Copy Markdown
Contributor

Closes #6390

@dlmarion dlmarion added this to the 4.0.0 milestone Jun 17, 2026
@dlmarion dlmarion self-assigned this Jun 17, 2026
Comment on lines +796 to +797
final int clearStateMins = 10;
final Duration clearStateDuration = Duration.ofMinutes(clearStateMins);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

With the check there we will only enter the code block once, instead of every clearStateDuration minutes.

dlmarion and others added 2 commits June 18, 2026 12:36
Co-authored-by: Dom G. <domgarguilo@apache.org>
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.

Prevent monitor's InformationFetcher from showing data that is too old after being idle

2 participants