Raw event cursors still count every repository's raw events
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 40/100
研究方向
Take #78's typed-event fix as the template — per-target counter, insert-lock trigger, per-target purge mark — because the raw path must mirror it. Read faucet/pgstore/queries/rawevents.sql:90 and :235 for the shared MAX(id) head, then the four call sites that surface it: faucet/rawpoll.go:190, faucet/rawsubscribe.go:167, faucet/rawdeliver.go:72 and :100. Reproduce the leak with a two-repository test before editing. Done when the four checks in the issue hold and an old r1. cursor restarts as truncated.
由索引模型根據 Issue 內容生成。
描述
Raw event cursors still let a caller count other repositories' raw events and time their arrival. #78 fixed this for typed events only.
Raw events are off unless FAUCET_RAW_EVENTS is set, and production does not set it. docs/security.md already names this as a known gap. Fix it before anyone turns raw events on.
Where the shared number reaches a caller (main 157e81b)
All raw positions are faucet_raw_events.id, one sequence for every repository:
faucet/pgstore/queries/rawevents.sql:90and:235: the head isMAX(id)over the whole table.faucet/rawpoll.go:190: theevents/pollcursor for a raw name (r1.<n>plus the lease).faucet/rawsubscribe.go:167: the subscribe reply cursor.faucet/rawdeliver.go:72and:100: the push watermark and the raw gap cursor.
Suggested fix
Do what #78 did for typed events. Give each target its own count of raw events, assigned under the insert lock by a trigger so an old build keeps numbering during a rolling deploy. Give each target its own purge mark. Return only positions on the named target's count. Never translate an old r1. cursor: restart it as truncated.
Done when
The checks from #78 hold for raw names:
- A reader of a quiet repository gets the same values whether or not other repositories receive raw events or get purged.
- A
maxAgeMsand cursor sweep gives the same answers with or without other repositories' traffic. - A resumed read skips and repeats nothing.
- A hand-made cursor stays on the reader's own count.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
- 主要語言
- Go
- 星號
- 1
- 分支
- 0
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
coder/faucet 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 4/5 3-5 天 新手友好度 35/100
-
難度 4/5 3-5 天 新手友好度 28/100
-
難度 3/5 1-2 天 新手友好度 68/100
-
難度 4/5 3-5 天 新手友好度 30/100
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 62/100
slavakurilyak/awesome-ai-agents#1026 ·
-
GetBatchResponseById panics for items without a body (204/302) and for unknown ids可能已有人在做 @0z5a 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
-
bug
難度 2/5 1-3 小時 新手友好度 80/100
JuliusBrussee/caveman#1567 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
-
bug postgresql
難度 2/5 1-3 小時 新手友好度 73/100
維護者通常 1 天內回覆