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

[SCB-2752] Filter out configurations with empty values #3587

Merged
merged 1 commit into from
Jan 29, 2023

Conversation

yanghao605
Copy link
Contributor

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [SCB-XXX] Fixes bug in ApproximateQuantiles, where you replace SCB-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install -Pit to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@fanjiwang1992 fanjiwang1992 added this to the 2.8.5 milestone Jan 13, 2023
@liubao68
Copy link
Contributor

Can you provide any information on how to reproduce the problem?

@yanghao605
Copy link
Contributor Author

image
我是在ConfigurationSpringInitializer的单元测试类中传了个值为null的环境变量,他这个在将配置由spring添加到archaius的时候,没有对value做非空校验,在后续的逻辑中会导致空指针异常

@liubao68
Copy link
Contributor

但是实际场景是怎么发生的了? 环境变量按照道理不会存在 null 的情况。

@yanghao605
Copy link
Contributor Author

有的业务将配置存储在数据库中,在服务启动的时候,从数据库中读取配置信息,并塞入spring的配置中,从而导致可能产生value为空的配置项

@liubao68
Copy link
Contributor

liubao68 commented Jan 29, 2023

如果是这样, 我理解这个修改不是很完整。 archaius不支持value=null的配置项, 而其他配置源支持,所以比较合理的修改应该是在将其他配置源复制到archaius的时候,统一过滤掉value=null的MAP键值对。

@liubao68 liubao68 merged commit a144631 into apache:master Jan 29, 2023
lbc97 pushed a commit to lbc97/servicecomb-java-chassis that referenced this pull request Feb 21, 2023
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.

None yet

3 participants