🟡 P2 | events.rs Mutex 投毒后静默丢事件 #44

Closed
opened 2026-06-06 12:33:03 +08:00 by wangdl · 1 comment
Owner

背景

push_reading_event 和 clear_exported_events 用 if let Ok(...) = lock() 忽略 MutexPoison。某处 panic 后所有事件静默丢失,调用方无感知。

修复方案

poison 后记录 warning 日志并清空缓冲区重建。

位置

crates/zx_document_core/src/events.rs:11-14, 33-37

## 背景 push_reading_event 和 clear_exported_events 用 if let Ok(...) = lock() 忽略 MutexPoison。某处 panic 后所有事件静默丢失,调用方无感知。 ## 修复方案 poison 后记录 warning 日志并清空缓冲区重建。 ## 位置 crates/zx_document_core/src/events.rs:11-14, 33-37
wangdl added this to the M6:Code Review 质量完善(2026-06-06) milestone 2026-06-06 12:33:03 +08:00
Author
Owner

修复完成 (2026-06-06)

实现

push_reading_event 改用 match 替代 if let,Mutex poison 时通过 into_inner() 恢复缓冲区。

状态

已修复。

## 修复完成 (2026-06-06) ### 实现 `push_reading_event` 改用 `match` 替代 `if let`,Mutex poison 时通过 `into_inner()` 恢复缓冲区。 ### 状态 ✅ 已修复。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wangdl/zhixi-document-runtime#44
No description provided.