Repository navigation
fix: activate Power1 via dsm template and fix deadlock - #204
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR fixes Power1 activation by using the shared service-manager plugin template and removes the startup deadlock by replacing front-end D-Bus interface proxies—which synchronously introspect dde-lock services—with raw message calls, asynchronous commands, and a one-second ShowAuth timeout. Sequence diagram for non-blocking Power1 front-end callssequenceDiagram
participant Power as PowerPlugin
participant Proxy as SessionDBusProxy
participant Bus as SessionBus
participant Front as dde-lock FrontServices
Power->>Proxy: requestSuspendByFront()
Proxy->>Bus: asyncCall(Suspend)
Bus-->>Proxy: queued
Power->>Proxy: showLockAuth(autoStart)
Proxy->>Bus: call(ShowAuth, Block, 1000)
Bus-->>Proxy: reply or timeout
Power->>Proxy: setBlackScreenActive(active)
Proxy->>Bus: asyncCall(setActive)
Bus-->>Proxy: queued
Note over Proxy,Front: Raw QDBusMessage calls avoid blocking introspection
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
TAG Bot New tag: 1.0.48 |
|
TAG Bot New tag: 1.0.49 |
|
TAG Bot New tag: 1.0.50 |
4cf3912 to
6894e07
Compare
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: [] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: [{'建议': '在 showLockAuth 和 setBlackScreenActive 中也添加类似注释,说明使用原始消息是为了避免 DDBusInterface 的阻塞式 Introspect 调用导致的死锁'}] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: [] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例// 建议:在 showLockAuth 和 setBlackScreenActive 中补充注释,保持一致性
void SessionDBusProxy::showLockAuth(bool autoStart)
{
// Raw messages only: avoid blocking Introspect from DDBusInterface.
QDBusMessage msg = QDBusMessage::createMethodCall(
kLockFront, kLockFrontPath, kLockFront, QStringLiteral("ShowAuth"));
msg << autoStart;
QDBusConnection::sessionBus().call(msg, QDBus::Block);
}
void SessionDBusProxy::setBlackScreenActive(bool active)
{
// Raw messages only: avoid blocking Introspect from DDBusInterface.
QDBusMessage msg = QDBusMessage::createMethodCall(
kBlackScreen, kBlackScreenPath, kBlackScreen, QStringLiteral("setActive"));
msg << active;
QDBusConnection::sessionBus().asyncCall(msg);
QDBusInterface kwin(QStringLiteral("org.kde.KWin"), QStringLiteral("/BlackScreen"),
QStringLiteral("org.kde.kwin.BlackScreen"),
QDBusConnection::sessionBus());
}本报告由 AI 代码审查工具自动生成 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 52cyb, mhduiy 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 |
1. The session D-Bus file declared SystemdService=org.deepin.dde.Power1.service, but dde-services never shipped that unit, so journald showed "Unit ... not found" and "read SleepLock property failed" from dde-lock. 2. After making the unit available, dde-lock's synchronous SleepLock call started a dedicated dsm instance whose power plugin synchronously introspected LockFront1/ShutdownFront1 exported by dde-lock, causing a 25s mutual wait: the desktop appeared first and the lock screen came back about 20s later. 3. Activate Power1 through deepin-service-manager's shared plugin template and drop the unused dedicated unit, matching the system-level service. 4. Replace the three front DDBusInterface proxies with raw QDBusMessage calls (async commands, synchronous ShowAuth with the default timeout) so power plugin startup no longer resolves or introspects dde-lock services. Log: Fix Power1 activation and dde-lock power startup deadlock. Influence: 1. Reboot and check `journalctl -fp err`: no "Unit org.deepin.dde.Power1.service not found" or "read SleepLock property failed". 2. Verify auto-login shows the lock screen immediately, not the desktop for about 20 seconds and then the login UI. 3. Verify lock/unlock, suspend/resume, hibernate and shutdown still work. 4. Check `systemctl --user list-units | grep Power1` shows deepin-service-plugin@org.deepin.dde.Power1.service. fix: 修正 Power1 激活方式并修复启动死锁 1. session 的 D-Bus 文件声明 SystemdService=org.deepin.dde.Power1.service,但 dde-services 从未 安装该 unit,导致 journal 出现 "Unit ... not found" 以及 dde-lock 的 "read SleepLock property failed"。 2. 补上 unit 后,dde-lock 同步读取 SleepLock 会拉起独立 dsm 实例;其 power 插件在初始化时同步 introspect dde-lock 导出的 LockFront1/ShutdownFront1,双方互等 25s,桌面先显示、锁屏约 20s 后才出现,表现为"自动回到登录界面"。 3. 改用 deepin-service-manager 的共享插件模板激活 Power1,删除未使用 的专用 unit,与系统级服务保持一致。 4. 把三个前端 DDBusInterface 改为原生 QDBusMessage 调用(命令异步、 ShowAuth 保持同步调用和默认超时),使 power 插件启动时不再 解析/introspect dde-lock 的服务。 Log: 修复 Power1 激活方式以及 dde-lock 与电源服务的启动死锁。 Influence: 1. 重启后检查 `journalctl -fp err`,不再出现 "Unit org.deepin.dde.Power1.service not found" 和 "read SleepLock property failed"。 2. 验证自动登录后锁屏立即出现,不再先显示桌面约 20s 再回到登录界面。 3. 验证锁屏/解锁、待机/唤醒、休眠、关机均正常。 4. 检查 `systemctl --user list-units | grep Power1` 显示 deepin-service-plugin@org.deepin.dde.Power1.service。 PMS: BUG-351573
|
/forcemerge |
|
This pr force merged! (status: blocked) |
SystemdService=org.deepin.dde.Power1.service, but dde-services never
shipped that unit, so journald showed "Unit ... not found" and
"read SleepLock property failed" from dde-lock.
started a dedicated dsm instance whose power plugin synchronously
introspected LockFront1/ShutdownFront1 exported by dde-lock, causing a
25s mutual wait: the desktop appeared first and the lock screen came
back about 20s later.
and drop the unused dedicated unit, matching the system-level service.
calls (async commands, synchronous ShowAuth with the default timeout)
so power plugin startup no longer resolves or introspects dde-lock
services.
Log: Fix Power1 activation and dde-lock power startup deadlock.
Influence:
journalctl -fp err: no "Unitorg.deepin.dde.Power1.service not found" or "read SleepLock property
failed".
for about 20 seconds and then the login UI.
systemctl --user list-units | grep Power1showsdeepin-service-plugin@org.deepin.dde.Power1.service.
fix: 修正 Power1 激活方式并修复启动死锁
SystemdService=org.deepin.dde.Power1.service,但 dde-services 从未
安装该 unit,导致 journal 出现 "Unit ... not found" 以及 dde-lock 的
"read SleepLock property failed"。
power 插件在初始化时同步 introspect dde-lock 导出的
LockFront1/ShutdownFront1,双方互等 25s,桌面先显示、锁屏约 20s
后才出现,表现为"自动回到登录界面"。
的专用 unit,与系统级服务保持一致。
ShowAuth 保持同步调用和默认超时),使 power 插件启动时不再
解析/introspect dde-lock 的服务。
Log: 修复 Power1 激活方式以及 dde-lock 与电源服务的启动死锁。
Influence:
journalctl -fp err,不再出现"Unit org.deepin.dde.Power1.service not found" 和
"read SleepLock property failed"。
systemctl --user list-units | grep Power1显示deepin-service-plugin@org.deepin.dde.Power1.service。
PMS: BUG-351573
Summary by Sourcery
Activate the Power1 service through the shared plugin infrastructure and eliminate the startup deadlock with dde-lock.
Bug Fixes:
Enhancements:
Chores: