Skip to content

[server] Fix coordinator metrics not updated when no events arrive#3148

Open
swuferhong wants to merge 3 commits intoapache:mainfrom
swuferhong:coordinator-metrics-hotfix
Open

[server] Fix coordinator metrics not updated when no events arrive#3148
swuferhong wants to merge 3 commits intoapache:mainfrom
swuferhong:coordinator-metrics-hotfix

Conversation

@swuferhong
Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #3147

After coordinator restart, if no client requests arrive, the
CoordinatorEventThread stays blocked on queue.take() and never
updates metrics gauges like activeTabletServerCount.

Fix by replacing queue.take() with queue.poll(timeout) so the
thread periodically wakes up to refresh metrics, and initializing
lastMetricsUpdateTime to 0 to trigger an immediate first update.

Brief change log

Tests

API and Format

Documentation

Copy link
Copy Markdown
Contributor

@platinumhamburg platinumhamburg left a comment

Choose a reason for hiding this comment

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

LGTM! Would you mind adding some tests for this PR?

@swuferhong
Copy link
Copy Markdown
Contributor Author

@platinumhamburg comments addressed.

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.

[server] Coordinator metrics not updated after restart when no events arrive

3 participants