Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

RelayRoom keeps a revoked Burrow forwarding when its sweep's row read fails

未关闭
#910 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript
领域
backend, security

调研方向

Start with RelayRoom.#sweep and RelayRoom.alarm in hosted/server/relay-room.ts, then read the timing constants in hosted/server/relay-room-contract.ts and the stalled row-read test in hosted/server/tests/relay-room.test.ts. Resolve the fail-open versus retry policy, update the code and test, and align the Relay boundary FAIL IF in docs/specs/security-hosted.md with the chosen behavior.

由索引模型根据 Issue 内容生成。

描述

Code: RelayRoom.#sweep in hosted/server/relay-room.ts; the alarm in RelayRoom.alarm re-arms RELAY_ROOM_SWEEP_MS (one hour, hosted/server/relay-room-contract.ts) out whatever the sweep did.

Failure path: a Burrow is removed or de-entitled by any path that does not reach closeBurrow (an entitlement change, or a removal whose closeBurrow RPC failed, which the DELETE route logs and answers 204 anyway). The next alarm calls #sweep. #rows throws (database error, or RELAY_ROW_READ_TIMEOUT_MS passes), the catch logs "could not sweep" and returns, and alarm() arms the next sweep an hour later. The socket keeps forwarding authenticated frames past the sweep it should have died at. If the database stays unreachable, it keeps forwarding through every later sweep too.

This breaks the docs/specs/security-hosted.md -> "Relay boundary" FAIL IF: "a removed or de-entitled Burrow's [socket] outlives the next sweep, at most RELAY_ROOM_SWEEP_MS while any Burrow socket is held". hosted/server/tests/relay-room.test.ts ("a stalled row read … leaves the sweep for later, the object's sockets open") pins the current behavior. Keeping sockets open on a failed read was a deliberate choice: #rows says a stalled read must not reset "the object and every socket it holds".

Suggested fix: decide the policy first, then change the code, test, and FAIL IF together. Options:

  1. Fail closed. On a failed sweep read, retire every held Burrow with a retryable close code. Each one reconnects through the upgrade, which rechecks its row under blockConcurrencyWhile and is refused while the database is down. This meets the FAIL IF exactly, at the cost of dropping every session during a database blip.
  2. Retry soon. On failure, arm the alarm at now + RELAY_ROW_READ_TIMEOUT_MS (or about a minute), not an hour, and fail closed only after N consecutive failures or once RELAY_ROOM_SWEEP_MS has passed since the last good sweep. Then reword the FAIL IF to "within RELAY_ROOM_SWEEP_MS of the last successful sweep".

Option 2 keeps the bound at one sweep interval, or a small multiple of it, without resetting sockets on a single slow query.

Found while trimming #904, which had parked this as a spec "Known gap".

🤖 Generated with Claude Code

主要语言
TypeScript
星标
5
派生
1
平均合并
12 小时 46 分钟
30 天内合并 PR
322

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

diffplug/dormouse 的其他 Issue

查看 diffplug/dormouse 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。