fix: fix daemon fail to init#222
Conversation
In the current implementation, the index verification operation is located between the event listening operation and the event receiving operation. If the index verification operation takes too long, the buffer may overflow due to storing a large number of file events, causing errors in event receiving and ultimately leading to daemon initialization failure. The current solution is to move the event listening operation after the index verification operation. 在当前的实现中, 索引校验操作位于事件监听操作和事件接收操作之间, 如果索引校验操作耗时过长, 就可能导致缓冲区因保存了大量的文件事件 而发生溢出, 这会导致事件接收时报错, 进而导致 daemon 初始化失败. 当前的修复方案是将事件监听操作放到索引校验操作之后. Log: 修复性能差的系统上索引更新失败 PMS: BUG-367093
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
deepin pr auto review★ 总体评分:88分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 diff --git a/src/daemon/src/main.cpp b/src/daemon/src/main.cpp
index bd84c5b..4036b10 100644
--- a/src/daemon/src/main.cpp
+++ b/src/daemon/src/main.cpp
@@ -100,11 +100,11 @@ int main(int argc, char* argv[]) {
detect_last_time_quit_status();
set_running_flag();
- event_listenser listenser;
print_event_handler_config(event_handler_config);
default_event_handler handler(event_handler_config);
// default_event_handler 实例化时, 可能会清空索引目录, 这里重新设置 running 标志
set_running_flag();
- event_listenser listenser;
+ event_listenser listener;
- listenser.set_handler([&handler](fs_event *event) {
+ listener.set_handler([&handler](fs_event *event) {
handler.handle(event);
}); |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, 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 |
|
/merge |
In the current implementation, the index verification operation is located between the event listening operation and the event receiving operation. If the index verification operation takes too long, the buffer may overflow due to storing a large number of file events, causing errors in event receiving and ultimately leading to daemon initialization failure.
The current solution is to move the event listening operation after the index verification operation.
在当前的实现中, 索引校验操作位于事件监听操作和事件接收操作之间,
如果索引校验操作耗时过长, 就可能导致缓冲区因保存了大量的文件事件
而发生溢出, 这会导致事件接收时报错, 进而导致 daemon 初始化失败.
当前的修复方案是将事件监听操作放到索引校验操作之后.
Log: 修复性能差的系统上索引更新失败
PMS: BUG-367093