Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the issue that a NullPointerException occurs when initialize the unified configuration #1593

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

hanbingleixue
Copy link
Collaborator

@hanbingleixue hanbingleixue commented Aug 5, 2024

What type of PR is this?

Bug

What this PR does / why we need it?

Fix the issue that a NullPointerException occurs when the configuration item type is set and the configuration content is empty during configuration initialization parsing. When the configuration type of a configuration item is collection and the configuration content is empty, an warning log is recorded. The LogEventCollector collects and reports warning logs. However, the event configuration is not initialized, so a NullPointerException is thrown on event collection

Which issue(s) this PR fixes?

Fixes #1591

Does this PR introduce a user-facing change?

No

Checklist

  • Make sure there is a GitHub_issue related with this PR before you start working on it.
  • Make sure you have squashed your change to one single commit.
  • GitHub Actions works fine in this PR.

Copy link

codecov bot commented Aug 5, 2024

Codecov Report

Attention: Patch coverage is 9.09091% with 10 lines in your changes missing coverage. Please review.

Files Patch % Lines
.../io/sermant/core/config/utils/ConfigValueUtil.java 0.00% 4 Missing ⚠️
...ain/java/io/sermant/core/event/EventCollector.java 20.00% 4 Missing ⚠️
...ermant/core/event/collector/LogEventCollector.java 0.00% 2 Missing ⚠️
Flag Coverage Δ Complexity Δ
unittests 43.02% <9.09%> (+0.03%) 182.00 <0.00> (+1.00)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ Complexity Δ
.../core/event/collector/FrameworkEventCollector.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...mant/router/common/event/RouterEventCollector.java 25.64% <ø> (-5.32%) 0.00 <0.00> (ø)
...covery/event/SpringBootRegistryEventCollector.java 22.58% <ø> (-6.84%) 0.00 <0.00> (ø)
...ermant/core/event/collector/LogEventCollector.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
.../io/sermant/core/config/utils/ConfigValueUtil.java 40.45% <0.00%> (-1.28%) 0.00 <0.00> (ø)
...ain/java/io/sermant/core/event/EventCollector.java 15.00% <20.00%> (-1.22%) 0.00 <0.00> (ø)

... and 25 files with indirect coverage changes

@hanbingleixue hanbingleixue changed the title Fixed the issue where a NullPointerException would occur when the a type of the configuration item is a collection and the configuration content is empty. Fix the issue that a NullPointerException occurs during configuration initialization parsing. Aug 5, 2024
@hanbingleixue hanbingleixue changed the title Fix the issue that a NullPointerException occurs during configuration initialization parsing. Fix the issue that a NullPointerException occurs during configuration initialization parsing Aug 5, 2024
@hanbingleixue hanbingleixue changed the title Fix the issue that a NullPointerException occurs during configuration initialization parsing Fix the issue that a NullPointerException occurs when the configuration item type is set and the configuration content is empty during configuration initialization parsing Aug 5, 2024
@hanbingleixue hanbingleixue changed the title Fix the issue that a NullPointerException occurs when the configuration item type is set and the configuration content is empty during configuration initialization parsing Fix the issue that a NullPointerException occurs when during configuration initialization parsing Aug 5, 2024
@hanbingleixue hanbingleixue changed the title Fix the issue that a NullPointerException occurs when during configuration initialization parsing Fix the issue that a NullPointerException occurs when configuration initialization parsing Aug 5, 2024
@hanbingleixue hanbingleixue changed the title Fix the issue that a NullPointerException occurs when configuration initialization parsing Fix the issue that a NullPointerException occurs when parsing the configuration initialization Aug 5, 2024
@hanbingleixue hanbingleixue changed the title Fix the issue that a NullPointerException occurs when parsing the configuration initialization Fix the issue that a NullPointerException occurs when initialize the unified configuration Aug 5, 2024
…a type of the configuration item is a collection and the configuration content is empty.

Signed-off-by: hanbingleixue <hanbingleixue@hotmail.com>
@Sherlockhan Sherlockhan merged commit 135e8e9 into sermant-io:develop Aug 19, 2024
281 checks passed
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.

ConfigManager#initialize phase, log warnings/errors, causing agent mount fail
4 participants