-
Notifications
You must be signed in to change notification settings - Fork 45
fix: Fix deepin-anything-daemon coredump #192
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
Conversation
When disk space is exhausted, deepin-anything-daemon will throw an exception upon startup due to failure to create the index directory.
|
TAG Bot TAG: 7.0.32 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReplace throwing of std::runtime_error with a controlled process exit on file index initialization failure to prevent coredumps when disk space is exhausted Sequence diagram for file_index_manager initialization failure handlingsequenceDiagram
participant D["deepin-anything-daemon"]
participant F["file_index_manager"]
participant L["LuceneException"]
D->>F: Initialize file_index_manager
F->>L: Attempt to create index directory
L-->>F: Throws LuceneException (e.g., disk full)
F->>D: Log critical error
F->>D: Exit process with APP_QUIT_CODE
Class diagram for updated file_index_manager error handlingclassDiagram
class file_index_manager {
+file_index_manager(persistent_index_dir, ...)
-On LuceneException: exit(APP_QUIT_CODE)
}
class LuceneException {
+getError()
}
file_index_manager --> LuceneException: handles exception
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deepin pr auto review我来对这段代码变更进行审查:
优点:
潜在问题:
改进建议:
try {
// 初始化代码
} catch (const LuceneException& e) {
std::string error_msg = "Failed to initialize file_index_manager: " + StringUtils::toUTF8(e.getError());
spdlog::critical(error_msg);
// 清理已分配的资源
cleanup_resources();
exit(APP_QUIT_CODE);
}
try {
// 初始化代码
} catch (const LuceneException& e) {
std::string error_msg = "Failed to initialize file_index_manager: " + StringUtils::toUTF8(e.getError());
spdlog::critical(error_msg);
throw InitializationException(error_msg);
}总体来说:
|
|
[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 |
When disk space is exhausted, deepin-anything-daemon will throw an exception upon startup due to failure to create the index directory.
Summary by Sourcery
Bug Fixes: