Commit 9dc7fb2
Fix race condition causing permanent loss of active rule files
When a repository update arrives, the stream handler removes rules from
the path_to_rules HashMap and re-inserts them asynchronously after
processing. If a second update arrives during this async gap (e.g. from
a git checkout or atomic file save), the remove returns None and the
update is silently dropped. If the first update was a deletion and the
dropped second update was the corresponding addition, the rules are
permanently lost until client restart.
Fix: clone the rules instead of removing them, so they remain available
in the HashMap during async processing. Queries see slightly stale
(pre-update) rules during the gap instead of no rules at all.
Co-Authored-By: Oz <oz-agent@warp.dev>1 parent 2f84587 commit 9dc7fb2
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
348 | | - | |
| 348 | + | |
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
| |||
0 commit comments