Skip to content

fix: increase ImageEffect D-Bus timeout for first-boot cold-start - #95

Open
mhduiy wants to merge 1 commit into
linuxdeepin:masterfrom
mhduiy:agent/pms-bug-bot/21e5187a97b6
Open

mhduiy wants to merge 1 commit into
linuxdeepin:masterfrom
mhduiy:agent/pms-bug-bot/21e5187a97b6

Conversation

@mhduiy

@mhduiy mhduiy commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

fix: increase ImageEffect D-Bus timeout for first-boot cold-start

  1. Root cause: wallpaper blur service migrated to on-demand plugin in
    dde-services, D-Bus cold-start (systemd + plugin load + Qt init +
    image processing) can exceed the hardcoded 2s timeout on first boot
  2. Fix: increase timeout from 2s to 5s as a safety net, the primary
    fix is pre-generating blur cache in dde-services before boot
  3. Impact: worst-case fallback delay increases from 2s to 5s, normal
    operation (cache hit) returns in milliseconds unaffected

Log: Increase wallpaper blur service timeout for first-boot reliability

Influence:

  1. Test first boot greeter shows blurred wallpaper within timeout
  2. Test subsequent boots are unaffected (cache hit returns fast)
  3. Verify fallback to original wallpaper still works if service fails

fix: 增加 ImageEffect D-Bus 超时时间应对首次启动冷启动延迟

  1. 根因:壁纸模糊服务迁移为 dde-services 按需激活插件后,D-Bus
    冷启动延迟(systemd 启动 + 插件加载 + Qt 初始化 + 图像处理)
    在首次启动时可能超过硬编码的 2 秒超时
  2. 方案:将超时从 2 秒增加到 5 秒作为保底措施,主要修复在
    dde-services 侧预生成模糊壁纸缓存
  3. 影响:最差情况回退延迟从 2 秒增至 5 秒,正常情况(缓存命中)
    毫秒级返回不受影响

Log: 增加壁纸模糊服务超时时间提升首次启动可靠性

Influence:

  1. 测试首次启动登录界面在超时内显示模糊壁纸
  2. 测试后续启动不受影响(缓存命中快速返回)
  3. 验证服务不可用时仍能回退到原始壁纸

PMS: BUG-335593

Summary by Sourcery

Bug Fixes:

  • Increase the ImageEffect D-Bus timeout to improve first-boot blurred wallpaper reliability during service cold starts.

1. Root cause: wallpaper blur service migrated to on-demand plugin in
   dde-services, D-Bus cold-start (systemd + plugin load + Qt init +
   image processing) can exceed the hardcoded 2s timeout on first boot
2. Fix: increase timeout from 2s to 5s as a safety net, the primary
   fix is pre-generating blur cache in dde-services before boot
3. Impact: worst-case fallback delay increases from 2s to 5s, normal
   operation (cache hit) returns in milliseconds unaffected

Log: Increase wallpaper blur service timeout for first-boot reliability

Influence:
1. Test first boot greeter shows blurred wallpaper within timeout
2. Test subsequent boots are unaffected (cache hit returns fast)
3. Verify fallback to original wallpaper still works if service fails

fix: 增加 ImageEffect D-Bus 超时时间应对首次启动冷启动延迟

1. 根因:壁纸模糊服务迁移为 dde-services 按需激活插件后,D-Bus
   冷启动延迟(systemd 启动 + 插件加载 + Qt 初始化 + 图像处理)
   在首次启动时可能超过硬编码的 2 秒超时
2. 方案:将超时从 2 秒增加到 5 秒作为保底措施,主要修复在
   dde-services 侧预生成模糊壁纸缓存
3. 影响:最差情况回退延迟从 2 秒增至 5 秒,正常情况(缓存命中)
   毫秒级返回不受影响

Log: 增加壁纸模糊服务超时时间提升首次启动可靠性

Influence:
1. 测试首次启动登录界面在超时内显示模糊壁纸
2. 测试后续启动不受影响(缓存命中快速返回)
3. 验证服务不可用时仍能回退到原始壁纸

PMS: BUG-335593
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mhduiy

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai

sourcery-ai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR increases the ImageEffect D-Bus request timeout from 2s to 5s so first-boot cold starts have more time to initialize the on-demand blur service and generate the blurred wallpaper; cache-hit behavior remains unchanged, with existing fallback behavior retained.

Sequence diagram for wallpaper blur request timeout

sequenceDiagram
    participant Background as FullScreenBackground
    participant DBus as ImageEffect D-Bus
    participant Service as OnDemandBlurService
    participant Cache as BlurCache

    Background->>DBus: Get(path)
    DBus->>Service: Start or handle request
    alt cache hit
        Service->>Cache: Get(path)
        Cache-->>Service: blurPath
        Service-->>DBus: blurPath
        DBus-->>Background: blurPath
    else first-boot cold start
        Service->>Cache: Generate and store blur
        Cache-->>Service: blurPath
        Service-->>DBus: blurPath
        DBus-->>Background: blurPath within 5s
    else request exceeds 5s or service fails
        DBus-->>Background: Error
        Background->>Background: Use original wallpaper
    end
Loading

File-Level Changes

Change Details Files
Extends the synchronous ImageEffect D-Bus call timeout to accommodate first-boot service cold-start latency.
  • Raises the timeout from 2 seconds to 5 seconds.
  • Preserves the existing GUI-aware blocking mode and error/fallback handling.
src/widgets/fullscreenbackground.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 98 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 总体评分 98 分,大于 70 分通过阈值,代码质量符合要求。本次修改将 D-Bus 超时从 2 秒增加到 5 秒,修复了首次启动冷启动时壁纸模糊服务超时的问题,修改合理且安全。

🔍 详细分析

1. 语法逻辑 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 语法正确,逻辑清晰,无需修改。


2. 代码质量 ✅

评价: 优秀 ✅ 通过

潜在问题:

  1. src/widgets/fullscreenbackground.cpp:188 - 超时值 5 * 1000 为硬编码魔法数字,建议提取为命名常量并添加注释说明

建议: 建议将超时值提取为命名常量(如 static constexpr int kBlurDbusTimeoutMs = 5000;),并添加注释说明首次启动冷启动场景下的超时选择依据。


3. 代码性能 ✅

评价: 优秀 ✅ 通过

潜在问题:

  1. src/widgets/fullscreenbackground.cpp:188 - BlockWithGui 模式下 5 秒超时可能阻塞 UI,虽 commit message 已说明合理性但仍有优化空间

建议: commit message 已说明正常情况(缓存命中)毫秒级返回不受影响,5 秒超时仅为保底措施。可考虑在 QDBus::BlockWithGui 模式下使用较短超时或异步调用以避免 UI 冻结。


4. 代码安全 🔒

评价: 优秀 ✅ 通过

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

建议: 无安全漏洞,D-Bus 调用使用标准 Qt API,参数传递安全,超时值修改不影响安全性。


💡 改进建议代码示例

// 建议将超时值提取为命名常量
// 在类定义或匿名命名空间中添加:
static constexpr int kBlurDbusTimeoutMs = 5000; // 5s timeout for first-boot cold-start

// 使用命名常量替代硬编码值:
QDBusPendingReply<QString> reply = QDBusConnection::systemBus().call(
    message, callMode, kBlurDbusTimeoutMs);

本报告由 AI 代码审查工具自动生成

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants