Skip to content

branch-4.0:[fix](metrics) Guard query instance metric before metric repo init (#62762) - #67254

Open
seawinde wants to merge 1 commit into
apache:branch-4.0from
seawinde:pr_62762_to_branch-4.0
Open

branch-4.0:[fix](metrics) Guard query instance metric before metric repo init (#62762)#67254
seawinde wants to merge 1 commit into
apache:branch-4.0from
seawinde:pr_62762_to_branch-4.0

Conversation

@seawinde

Copy link
Copy Markdown
Member

pr: #62762
commitId: d3d28c8

…pache#62762)

### What problem does this PR solve?

Problem Summary:
FE may throw a `NullPointerException` while registering query instances during startup or role switch.

Root cause: In `QeProcessorImpl.registerInstances()`

(`fe/fe-core/src/main/java/org/apache/doris/qe/QeProcessorImpl.java:164`),
query instance accounting always updates
`MetricRepo.USER_COUNTER_QUERY_INSTANCE_BEGIN`, but `MetricRepo.init()` may
not have completed yet, so the metric mapping is still unavailable.

This PR keeps the existing query-instance accounting logic unchanged and
only skips the metric increment until the metric repo is initialized.
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@seawinde

Copy link
Copy Markdown
Member Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 100.00% (2/2) 🎉
Increment coverage report
Complete coverage report

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.

2 participants