boekkooi-lengoo commented on issue #9051:
URL: https://github.com/apache/apisix/issues/9051#issuecomment-1467656048

   So I did some digging by adding the log `log.warn("change: ", 
json.encode(attributes))` on 
https://github.com/apache/apisix/blob/master/apisix/core/config_yaml.lua#L82.
   
   This results in the following information we reloads occur.
   **First reload shows.**
   ```JSON
   {
   "size": 18017,
   "dev": 2049,
   "ino": 5355318,
   "nlink": 1,
   "access": 1678782885,
   "gid": 1337,
   "rdev": 0,
   "permissions": "rw-r--r--",
   "modification": 1678726697,
   "blocks": 40,
   "blksize": 4096,
   "mode": "file",
   "uid": 0,
   "change": 1678782885
   }
   ```
   **Second reload shows.**
   ```JSON
   {
     "size": 18017,
     "dev": 2049,
     "ino": 5355318,
     "nlink": 1,
     "access": 1678782803,
     "gid": 1337,
     "rdev": 0,
     "permissions": "rw-r--r--",
     "modification": 1678726697,
     "blocks": 40,
     "blksize": 4096,
     "mode": "file",
     "uid": 0,
     "change": 1678782803
   }
   ```
   Now this shows that the `change` is updated. As [`lfs`](r 
http://lunarmodules.github.io/luafilesystem) uses 
[`stat`](https://linux.die.net/man/2/stat) which states the following it means 
that in my case we get false reloads which cause the log entries.
   > The field st_ctime is changed by writing or by setting inode information 
(i.e., owner, group, link count, mode, etc.).
   
   Based on the documentation of `lfs.attributes` under 
http://lunarmodules.github.io/luafilesystem/manual.html#reference which shows 
that `change` is the `time of last file status change` and `modification` is 
`time of last data modification` I think `modification` (mtime) should be used 
instead of `change` (ctime).
   
   What do you think @monkeyDluffy6017? Should I open a PR?
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to