Title: ROX-33328: Avoid cache re-poisoning during coalesced fetches by clickboo · Pull Request #19600 · stackrox/stackrox · GitHub
Open Graph Title: ROX-33328: Avoid cache re-poisoning during coalesced fetches by clickboo · Pull Request #19600 · stackrox/stackrox
X Title: ROX-33328: Avoid cache re-poisoning during coalesced fetches by clickboo · Pull Request #19600 · stackrox/stackrox
Description: Description Generation counter for stale-write prevention: A targeted invalidation or full cache flush can race with an in-flight fetch: the fetch starts before the invalidation, the invalidation clears the cache, then the fetch completes and writes stale data back. Admittedly this window is very small, however it is possible. And aggravates the stale data problem when we increase/remove the TTL concept from the admission controller image cache. To prevent this, a per-key generation counter (imageGenTracker) is incremented on invalidation. In-flight fetches capture a generation snapshot before the fetch call and compare it after — if the generation changed, the result is not cached. This ensures invalidation takes effect immediately rather than being masked for the duration of the cache entry's lifetime. The generation counters get wiped out every reprocessing interval, because the periodic reprocessing triggers a full flush of the admission controller cache. User-facing documentation CHANGELOG.md is updated OR update is not needed documentation PR is created and is linked above OR is not needed Testing and quality the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag CI results are inspected Automated testing added unit tests added e2e tests added regression tests added compatibility tests modified existing tests How I validated my change Tested this as a part of the stack, along with PR #19837 and #19840.
Open Graph Description: Description Generation counter for stale-write prevention: A targeted invalidation or full cache flush can race with an in-flight fetch: the fetch starts before the invalidation, the invalidation c...
X Description: Description Generation counter for stale-write prevention: A targeted invalidation or full cache flush can race with an in-flight fetch: the fetch starts before the invalidation, the invalidation c...
Opengraph URL: https://github.com/stackrox/stackrox/pull/19600
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:7cb962ef-8240-19cf-7ef6-2a33f21557c0 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 80F4:37E3D3:4786F34:6500583:6A4FC4D2 |
| html-safe-nonce | cf2526a035f3d1b625a6ff80108c2ba2beb90a8338b3eb4c100a1726322526f0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MEY0OjM3RTNEMzo0Nzg2RjM0OjY1MDA1ODM6NkE0RkM0RDIiLCJ2aXNpdG9yX2lkIjoiNDk1MDE4MDEyMjYyMjUzNzc4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a89cbe2e2fbb3b4e2b538886b285383b9f2fd20957dba5c210e0ca3f50acb358 |
| hovercard-subject-tag | pull_request:3444468488 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/stackrox/stackrox/pull/19600/files |
| twitter:image | https://avatars.githubusercontent.com/u/42253461?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/42253461?s=400&v=4 |
| og:image:alt | Description Generation counter for stale-write prevention: A targeted invalidation or full cache flush can race with an in-flight fetch: the fetch starts before the invalidation, the invalidation c... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d8f8209b188a80e19a6957836ab9229715797be5db1a04163963c674ccc33f6 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/stackrox/stackrox git https://github.com/stackrox/stackrox.git |
| octolytics-dimension-user_id | 40638982 |
| octolytics-dimension-user_login | stackrox |
| octolytics-dimension-repository_id | 434017296 |
| octolytics-dimension-repository_nwo | stackrox/stackrox |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 434017296 |
| octolytics-dimension-repository_network_root_nwo | stackrox/stackrox |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ea848e83cf3bf3613dd7b13d52965a684fd23ec5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width