nacos icon indicating copy to clipboard operation
nacos copied to clipboard

[Bug] Watch the wrong application.properties file when starting up the nacos server

Open lingyufei opened this issue 1 year ago • 0 comments

Describe the bug When staging up the nacos server, registerWatcher would be invoked. However, the file being watched is /home/user/nacos/conf/application.properties, and the file and properties being reloaded in the onChange method is classpath/application.properties or ${spring.config.additional-location}/application.properties. It's inconsistent.

Expected behavior The file being watched and the file being reloaded should be the same, which should be classpath/application.properties or ${spring.config.additional-location}/application.properties.

Actually behavior Currently, the file being watched is /home/user/nacos/conf/application.properties, and the file and properties being reloaded in the onChange method is classpath/application.properties or ${spring.config.additional-location}/application.properties.

How to Reproduce Steps to reproduce the behavior:

  1. Go to 'com.alibaba.nacos.core.listener.StartingApplicationListener#registerWatcher'
  2. Check the following code: image

Desktop (please complete the following information):

  • OS: macos
  • Version 2.4.1

Additional context Add any other context about the problem here.

lingyufei avatar Aug 20 '24 02:08 lingyufei