Commit fc55c41
fix(dict): dict_remove no longer inflates the hash table exponentially
env_hash_rebuild blindly doubled the old capacity — right for the
grow-on-insert callers (all rebuild at >70% load), catastrophic for
dict_remove's re-index rebuild: N removes on one dict grew its table
by 2^N, so ~25 insert/remove cycles of a single key allocated
gigabytes and aborted OOM. Size the new table from the live entry
count instead — identical doubling behavior at the grow sites, no
inflation on remove.
Surfaced by liferaft's per-message pending-registry churn during the
#523 task-layer migration; regression-pinned with a 200-cycle churn
test (impossible pre-fix, instant post-fix) plus a survivors-resolve
check in tests/test_dict.eigs.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 2ca5f5e commit fc55c41
3 files changed
Lines changed: 42 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
194 | 202 | | |
195 | 203 | | |
196 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1291 | 1291 | | |
1292 | 1292 | | |
1293 | 1293 | | |
1294 | | - | |
1295 | | - | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
1296 | 1303 | | |
1297 | 1304 | | |
1298 | 1305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
62 | 87 | | |
0 commit comments