main · last commit
1 month ago ·
2npkec0r
tarantool-etcd-1rs No ErrWatcherDuplicateID; watch ids are globally scoped, so two streams collide
Lined Up
bd update tarantool-etcd-1rs --claim
bd close tarantool-etcd-1rs
| Created by | Eugene Blikh |
| Owner | bigbes@gmail.com |
| Created | 2026-07-17T13:20:16Z |
| Updated | 2026-07-17T13:20:16Z |
etcd rejects a reused or negative watch id with created=true, canceled=true, cancel_reason='duplicate watch ID' (mvcc/watcher.go). app/etcd/watch.lua:331 does 'watchers[watch_id] = w' with no in-use check, and the registry (watch.lua:42-44) is MODULE-GLOBAL rather than per-stream. So two different client connections that both choose the same custom watch id collide — stream A's fiber can drain stream B's events. Cross-connection data leak between unrelated clients, not just a protocol nicety. Route-level: grpc.lua:448.
Key the registry by (stream, watch_id) rather than watch_id alone, and reject in-use/negative ids with the etcd-shaped cancel. The global registry may have other consumers — check before re-keying.
Two streams using the same custom watch id do not interfere; reused id on one stream returns the duplicate-ID cancel; negative id rejected; test covers the cross-stream case.
No outgoing dependencies.
Nothing depends on this issue.
| id | tarantool-etcd-1rs |
| content_hash | b3af9b9653f2aefab78554f22ffe2433f695a04c58411920ae4c1915f6a71c5b |
| title | No ErrWatcherDuplicateID; watch ids are globally scoped, so two streams collide |
| description | etcd rejects a reused or negative watch id with created=true, canceled=true, cancel_reason='duplicate watch ID' (mvcc/watcher.go). app/etcd/watch.lua:331 does 'watchers[watch_id] = w' with no in-use check, and the registry (watch.lua:42-44) is MODULE-GLOBAL rather than per-stream. So two different client connections that both choose the same custom watch id collide — stream A's fiber can drain stream B's events. Cross-connection data leak between unrelated clients, not just a protocol nicety. Route-level: grpc.lua:448. |
| design | Key the registry by (stream, watch_id) rather than watch_id alone, and reject in-use/negative ids with the etcd-shaped cancel. The global registry may have other consumers — check before re-keying. |
| acceptance_criteria | Two streams using the same custom watch id do not interfere; reused id on one stream returns the duplicate-ID cancel; negative id rejected; test covers the cross-stream case. |
| notes | |
| status | open |
| priority | 2 |
| issue_type | bug |
| assignee | NULL |
| estimated_minutes | NULL |
| created_at | 2026-07-17T13:20:16Z |
| created_by | Eugene Blikh |
| owner | bigbes@gmail.com |
| updated_at | 2026-07-17T13:20:16Z |
| closed_at | NULL |
| closed_by_session | |
| external_ref | NULL |
| spec_id | |
| compaction_level | 0 |
| compacted_at | NULL |
| compacted_at_commit | NULL |
| original_size | NULL |
| sender | |
| ephemeral | 0 |
| wisp_type | |
| pinned | 0 |
| is_template | 0 |
| mol_type | |
| work_type | |
| source_system | |
| metadata | <binary> |
| source_repo | |
| close_reason | |
| event_kind | |
| actor | |
| target | |
| payload | |
| await_type | |
| await_id | |
| timeout_ns | 0 |
| waiters | |
| hook_bead | |
| role_bead | |
| agent_state | |
| last_activity | NULL |
| role_type | |
| rig | |
| due_at | NULL |
| defer_until | NULL |
| no_history | 0 |
| started_at | NULL |
| is_blocked | 0 |
| issue_id | tarantool-etcd-1rs |
| label | etcd-changelog-sweep |
| id | 019f703c-1ed1-75ff-b342-4d21e9bdb89d |
| issue_id | tarantool-etcd-1rs |
| event_type | created |
| actor | Eugene Blikh |
| old_value | |
| new_value | |
| comment | NULL |
| created_at | 2026-07-17T16:20:16Z |
| id | 019f703c-1ed1-7b52-80fd-b05c58f7e9eb |
| issue_id | tarantool-etcd-1rs |
| event_type | label_added |
| actor | Eugene Blikh |
| old_value | NULL |
| new_value | NULL |
| comment | Added label: etcd-changelog-sweep |
| created_at | 2026-07-17T16:20:16Z |
No comments.