Files
MemRelay/projects/25464650-ed5d-440e-b362-190f2852d451/Checkpoint 2026-09-30 09-28-54 UTC [3c19908d0f].md
T
memrelay 3e760e8af5 create: Checkpoint 2026-09-30 09:28:54 UTC [3c19908d0f]
MemRelay-Operation: checkpoint-save:r3-67-queue-close-deadlock-20260930
MemRelay-Resource: 0013a18c-bf1b-40b5-a9cb-bbd3ad6e6848
2026-09-30 17:29:11 +08:00

44 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: Checkpoint 2026-09-30 09:28:54 UTC [3c19908d0f]
type: checkpoint
permalink: main/projects/25464650-ed5d-440e-b362-190f2852d451/checkpoint-2026-09-30-09-28-54-utc-3c19908d0f
stable_id: 0013a18c-bf1b-40b5-a9cb-bbd3ad6e6848
scope: project
memory_type: checkpoint
project_id: 25464650-ed5d-440e-b362-190f2852d451
usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998
status: active
revision: 1
request_id: r3-67-queue-close-deadlock-20260930
created_at: '2026-09-30T09:28:54.981235+00:00'
updated_at: '2026-09-30T09:28:54.981235+00:00'
tags:
- ready-to-merge
- r3-03
- issue-67
---
# 检查点:R3-03 / issue #67 写队列 Close 死锁已修
## 完成
- 分支 `feat/fix-r3-67-queue`,工作树 `E:/code/NixMsg-wt/r3-67`(非主工作树)
- HEAD `eb4cb7c655e5bb6796c2514aaa4a714d0b4c3b3e`:`fix: 写队列满时 Close 不再与 enqueue 死锁`
- 已推送 origin;已在 Gitea #67 评论(comment 485)
- 未合 main
## 关键实现
- `Queue.closing`:Close 先 Swap(closed)+close(closing),唤醒持读锁堵在满通道上的 enqueue
- enqueue 的 select 同时等 q.ch / closing / ctx.Done()
- 再 sendMu.Lock 后 close(q.ch),等 loop 退出;不向已关闭 channel 发送
- DEVIATIONS 末尾 `### 复审修复 R3-03`
## 验证
- `go test ./internal/store/ -count=1 -run "Queue|WriteQueue"` 通过
- 新增:满通道+堵住写端时 Close 能解开 enqueue;超时 Drain 短时返回
## 下一步
- 总控审阅后 ff-only 合入 main
## 给下个会话
- 只改了 queue.go / queue_test.go / DEVIATIONS R3-03;不改迁移