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

[BUG] 使用全局viper进行yaml解析,会出现并发读写map的fatal error #321

Open
erberry opened this issue Oct 21, 2024 · 1 comment
Assignees

Comments

@erberry
Copy link

erberry commented Oct 21, 2024

为什么使用了一个全局的viper对象对yaml进行解析,viper不是并发安全的。

https://github.com/apolloconfig/agollo/blob/v4.4.0/utils/parse/yaml/parser.go#L26

Is it safe to concurrently read and write to a viper?
No, you will need to synchronize access to the viper yourself (for example by using the sync package). Concurrent reads and writes can cause a panic.

Copy link

stale bot commented Dec 20, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants