Keep JSONRPC output backpressure outside configuration and deduplication locks
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- rust
- 领域
- api, backend, performance, testing
调研方向
Start by reading crates/pet-reporter/src/cache.rs, crates/pet/src/jsonrpc.rs, and crates/pet-jsonrpc/src/lib.rs, then review the transport seams from #529/#532 and generation semantics from #536. Validate the design with controlled slow-consumer tests; done means bounded output buffering, correct generation and ordering behavior, explicit failures, and coverage for saturation, closed output, and shutdown.
由索引模型根据 Issue 内容生成。
描述
Tracking plan: #528
Priority: P2. Evidence: lock scopes confirmed by source inspection; reproduce impact with controlled slow-consumer tests.
Problem
The deduplicating reporter invokes its downstream reporter while holding the manager/environment map write lock. The generation-guarded reporter holds the configuration read lock through notification reporting. The downstream JSONRPC writer synchronously writes/flushes stdout.
A slow or disconnected consumer can therefore couple transport I/O to discovery deduplication and configuration publication. The audit does not claim a measured production deadlock; the first task is to prove the coupling and required ordering with deterministic tests.
Sources: deduplicating reporter, generation reporter, framed output.
Scope
Separate deduplication and generation decisions from blocking output. Evaluate a bounded single-writer queue or equivalent narrow transport boundary; do not replace lock contention with an unbounded memory queue. Define exactly where generation checks occur and how notification/reply ordering is guaranteed when configure races with queued output.
Make serialization/write/flush failures explicit and preserve stdout as framed protocol output only. Rename CacheReporter around deduplication if the type is changed, and retain only the data its behavior needs.
Acceptance criteria
- A controllably blocked output sink cannot hold the configuration or deduplication locks for the duration of the write.
- Tests cover slow consumers, closed output, queue saturation, and shutdown with pending notifications.
- Stale-generation notifications are suppressed at the documented publication boundary, including configure racing with queued output.
- Environment/manager deduplication remains atomic; a refresh reply cannot overtake the notifications it is defined to complete.
- Concurrent replies/notifications remain correctly framed, with bounded buffering and explicit error propagation.
- #531/#533 show no regression in complete-inventory correctness, first-result latency, or resource bounds.
Dependencies
Depends on #536 for generation/snapshot semantics and #533 for slow-consumer/resource validation. Build on the transport seams from #529/#532. Coordinate with bounded scheduling #539 rather than introducing a second conflicting queue policy. The complete sequence is in #528.
- 主要语言
- Rust
- 星标
- 207
- 派生
- 45
- 平均合并
- 8 小时 19 分钟
- 30 天内合并 PR
- 2
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/python-environment-tools 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
microsoft/python-environment-tools#525 · 1 条评论 ·
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
-
debt
难度 5/5 一周以上 新手友好度 25/100
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
查看 microsoft/python-environment-tools 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
-
issue
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
agentic-workflows
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 88/100
web-infra-dev/rspack#15847 ·