-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Error creating cache directory at startup time [starting the time register to create a cache directory error] #1840
Comments
Error creating cache directory at startup time [starting the time register to create a cache directory error]Issue DescriptionType: bug report Describe what happened (or what feature you want)Error creating cache directory at startup time Describe what you expected to happenOccasionally reporting cache creation errors at startup,The error message is as follows: java.lang.IllegalStateException: failed to create cache dir: /root/nacos/naming/public
How to reproduce it (as minimally and precisely as possible)start up Tell us your environmentcentos 7、java8 Anything else we need to know?Inside the com.alibaba.nacos.client.naming.cache.DiskCache class |
I think this might happen rarely and only happen at first time(the directory /root/nacos/naming/public not exists). |
Has it happened to you many times? |
My application runs in docker, so every update will create a new docker container, and this error is often visible. |
Virgo, it's not good to see any mistakes. |
When the application of the new docker container restarts, there will be multiple configuration information to be cached. Example A first determines whether the directory exists or not, and then creates the directory if it does not exist. This takes a little time. When instance A has not built the directory yet, Example B judges that the directory does not exist, and also does the operation of creating the directory. Failure to create directories |
I suppose this is thread conflicted at first, but now i think that is JVM conflicted . |
Issue Description
Type: bug report
Describe what happened (or what feature you want)
Error creating cache directory at startup time
启动时报建立缓存目录错误
Describe what you expected to happen
Occasionally reporting cache creation errors at startup,The error message is as follows:
启动时偶发性报建立缓存错误,错误信息如下:
java.lang.IllegalStateException: failed to create cache dir: /root/nacos/naming/public
How to reproduce it (as minimally and precisely as possible)
启动
Tell us your environment
centos 7、java8
Anything else we need to know?
com.alibaba.nacos.client.naming.cache.DiskCache类里面
第49行第50行的注释做了多实例冲突的优化处理,然而第153行同样的场景却未做同样的优化处理。
Inside the com.alibaba.nacos.client.naming.cache.DiskCache class
The comment in line 49, line 50, optimizes multi-instance conflicts, but the same scenario in line 153 does not.
The text was updated successfully, but these errors were encountered: