jplevyak commented on PR #13893: URL: https://github.com/apache/trafficserver/pull/13893#issuecomment-6356449915
<!-- address-comments-summary --> ## Address-comments run — 2026-10-23 Addressed in d5bbd653e. <table> <tr><th>Comment</th><th>File / Topic</th><th>Label</th><th>Action / Reason</th></tr> <tr><td>4352810653, 4352810729</td><td>O(N) <code>_decay_epoch()</code> walk in <code>put()</code></td><td>FIX</td><td>Decay is now lazy. <code>_decay_epoch()</code> just bumps a global epoch (O(1)), and each entry carries the epoch of its last decay. <code>_apply_decay()</code> catches it up (<code>hits >>= elapsed</code>, cleared at 32 or more epochs) wherever <code>hits</code> is read: get() resident and history hits, put() on an existing entry, eviction victims, and <code>_tick()</code>. <code>hits</code> was split into 32-bit <code>hits</code> plus <code>epoch</code>, so the entry stays the same size.</td></tr> <tr><td>4352810784</td><td><code>requeue_count</code> int64_t to int narrowing</td><td>FIX-EASY</td><td>Now <code>int64_t</code>. It couldn't actually truncate, since it's capped at 100.</td></tr> <tr><td>4352810830</td><td><code>hits = 2</code> also affects resident entries</td><td>SKIP-WRONG</td><td>That assignment is under <code>Lhistory:</code> and only creates history entries (<code>flag_bits.lru = 1</code>, queued on <code>_lru[1]</code>). New resident entries are created under <code>Linsert:</code> and still start at <code>hits = 1</code>.</td></tr> <tr><td>4352810884</td><td>Overlapping u64/u32 writes in test <code>make_key</code></td><td>FIX-EASY</td><td>Keys are now written only through <code>u32[]</code>. The <code>CryptoHash</code> constructor already zeroes the key.</td></tr> </table> Tests: the epoch-decay test now checks that decay is deferred until the entry is touched. A new test covers decay across several epochs and clearing after 32 or more. _Items marked SKIP-WRONG include the evidence above._ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
