feat: track file close-write events - #253
Conversation
Add tracking for file close-write events. Log: 新增文件写关闭事件追踪 PMS: BUG-370789 Influence: 内核模块现在能够追踪文件写关闭事件,增强文件变更监控能力。
Add ACT_CLOSE_WRITE_FILE event handling to update file index when a file is written and closed, skipping non-existent files. 添加 ACT_CLOSE_WRITE_FILE 事件处理,文件写入关闭后更新索引, 通过 make_file_record 判断文件是否存在,不存在则跳过。 Log: 添加文件写入关闭事件的索引更新处理 PMS: BUG-370789 Influence: 文件被写入并关闭后,索引将自动更新文件元数据,保证搜索结果时效性。
Wrap the cmp_event_path macro expression in parentheses to prevent operator precedence issues when used in larger expressions. 为 cmp_event_path 宏表达式添加括号,防止在复杂表达式中使用时出现运算符优先级问题。 Log: 修复 cmp_event_path 宏缺少括号的问题 PMS: BUG-370789 Influence: 修复后宏在复杂表达式中能正确求值,避免事件路径比较逻辑错误。
As title. Log: Bump version to 7.0.61
There was a problem hiding this comment.
Sorry @wangrong1069, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wangrong1069 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
TAG Bot TAG: 7.0.61 |
Reviewer's GuideAdds support for tracking and indexing file close-write events end-to-end, from kernel monitoring and event merging through daemon handling and index updates, while refactoring server event dispatching logic for mounts and path prefixing. Sequence diagram for file close-write indexingsequenceDiagram
participant Kernel as Kernel fsnotify
participant Probe as __fput kretprobe
participant Server as Event dispatcher
participant Daemon as Default event handler
participant Queue as Index job queue
participant Index as File index manager
Kernel->>Probe: __fput(file)
Probe->>Probe: on___fput_ent()
Probe->>Server: ACT_CLOSE_WRITE_FILE(path)
Server->>Server: convert_fs_event()
Server->>Daemon: file_close_write(path)
Daemon->>Daemon: filter_event()
Daemon->>Queue: update_index_delay(path)
Queue->>Index: update_index(path)
Index->>Index: make_file_record(path)
alt file exists
Index->>Index: updateDocument(path)
else file does not exist
Index-->>Queue: Skip update
end
Flow diagram for close-write event mergingflowchart TD
CloseWrite["close_write(X)"] --> NextEvent{Next event}
NextEvent -->|delete X| RemoveClose["Remove close_write(X)"]
NextEvent -->|rename from X| RemoveClose
NextEvent -->|other event| Retain["Retain close_write(X)"]
RemoveClose --> MergeFail["Merge fails for current event"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary by Sourcery
Track file close-write events so modified files are reindexed when writing completes.
New Features:
Bug Fixes:
Enhancements:
Chores: