fix: Implement process timeout handling in SpawnCmd#572
Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom Sep 25, 2025
Merged
fix: Implement process timeout handling in SpawnCmd#572deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: re2zero 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 |
- Updated SpawnCmd to wait for process completion with a default timeout. This change improves the robustness of command execution by preventing indefinite hangs. Log: Fix the database may be incompletely created, resulting in no searches. Bug: https://pms.uniontech.com/bug-view-335337.html
|
TAG Bot TAG: 6.5.40 |
lzwind
approved these changes
Sep 25, 2025
Contributor
|
This pr cannot be merged! (status: unstable) |
Contributor
Author
|
/forcemerge |
Contributor
|
This pr force merged! (status: unstable) |
This was referenced Sep 25, 2025
Closed
deepin pr auto review根据提供的git diff,我将对代码进行审查,并提出改进意见:
// 原代码
process.waitForFinished(-1);
// 新代码
bool finished = process.waitForFinished();
if (!finished) {
qCWarning(app) << "Command timed out, terminating process";
process.kill();
process.waitForFinished(500);
return false;
}改进建议: a) 性能方面:
const int DEFAULT_TIMEOUT = 30000; // 30秒
bool finished = process.waitForFinished(DEFAULT_TIMEOUT);b) 错误处理:
c) 代码质量:
d) 安全性:
总体来说,这次修改提高了程序的健壮性,特别是添加了命令执行超时处理,这是一个很好的改进。建议按照上述建议进一步完善代码,提高其可维护性和安全性。 |
Contributor
|
/retest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Log: Fix the database may be incompletely created, resulting in no searches.