Skip to content

ref(preprod): Use TimeToIdle instead of TimeToLive for upload expiration#115837

Merged
NicoHinderling merged 3 commits into
masterfrom
ref/preprod-time-to-idle
May 19, 2026
Merged

ref(preprod): Use TimeToIdle instead of TimeToLive for upload expiration#115837
NicoHinderling merged 3 commits into
masterfrom
ref/preprod-time-to-idle

Conversation

@NicoHinderling
Copy link
Copy Markdown
Contributor

Switch the objectstore expiration policy from TimeToLive to TimeToIdle
so that preprod snapshots that are still being accessed are not expired
after a fixed 30-day window. With TimeToIdle, the expiration timer resets
on each access, keeping actively-used snapshots alive.

@NicoHinderling NicoHinderling marked this pull request as ready for review May 19, 2026 19:49
@NicoHinderling NicoHinderling requested a review from a team as a code owner May 19, 2026 19:49
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 19, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 19c2247. Configure here.

Comment thread src/sentry/preprod/api/endpoints/project_preprod_upload_options.py Outdated
@NicoHinderling NicoHinderling requested a review from a team as a code owner May 19, 2026 19:54
_OBJECTSTORE_CLIENT: Client | None = None
_ATTACHMENTS_USECASE: Usecase | None = None
_PREPROD_USECASE = Usecase("preprod", expiration_policy=TimeToLive(timedelta(days=30)))
_PREPROD_USECASE = Usecase("preprod", expiration_policy=TimeToIdle(timedelta(days=30)))
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only made this change bcuz bugbot suggested it but not sure if we should, defer to objectstore folks

Copy link
Copy Markdown
Contributor

@matt-codecov matt-codecov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, don't know why tests fail

NicoHinderling and others added 3 commits May 19, 2026 13:38
Switch the objectstore expiration policy from TimeToLive to TimeToIdle
so that snapshots that are still being accessed are not expired after a
fixed 30-day window.

Co-Authored-By: Claude <noreply@anthropic.com>
The previous commit updated the upload options endpoint to return
TimeToIdle but missed the server-side _PREPROD_USECASE definition,
creating a mismatch between client-facing and server-enforced
expiration policy.

Co-Authored-By: Claude <noreply@anthropic.com>
Update test to expect tti: prefix after TimeToLive → TimeToIdle rename.
Add comment explaining that TTI intentionally resets on fetch so actively
viewed snapshots do not silently expire.

Co-Authored-By: Claude <noreply@anthropic.com>
@NicoHinderling NicoHinderling force-pushed the ref/preprod-time-to-idle branch from 892155e to 8ba38cf Compare May 19, 2026 20:46
@NicoHinderling NicoHinderling merged commit 43554b4 into master May 19, 2026
63 checks passed
@NicoHinderling NicoHinderling deleted the ref/preprod-time-to-idle branch May 19, 2026 20:59
@runningcode runningcode added the Trigger: Revert Add to a merged PR to revert it (skips CI) label May 20, 2026
@getsentry-bot
Copy link
Copy Markdown
Contributor

PR reverted: ac9acca

getsentry-bot added a commit that referenced this pull request May 20, 2026
… expiration (#115837)"

This reverts commit 43554b4.

Co-authored-by: runningcode <332597+runningcode@users.noreply.github.com>
JonasBa pushed a commit that referenced this pull request May 21, 2026
…ion (#115837)

Switch the objectstore expiration policy from `TimeToLive` to
`TimeToIdle`
so that preprod snapshots that are still being accessed are not expired
after a fixed 30-day window. With `TimeToIdle`, the expiration timer
resets
on each access, keeping actively-used snapshots alive.

---------

Co-authored-by: Claude <noreply@anthropic.com>
JonasBa pushed a commit that referenced this pull request May 21, 2026
… expiration (#115837)"

This reverts commit 43554b4.

Co-authored-by: runningcode <332597+runningcode@users.noreply.github.com>
NicoHinderling added a commit that referenced this pull request May 21, 2026
…ion (#116033)

Switch the objectstore expiration policy from `TimeToLive` to
`TimeToIdle`
so that preprod snapshots that are still being accessed are not expired
after a fixed 30-day window. With `TimeToIdle`, the expiration timer
resets
on each access, keeping actively-used snapshots alive.

This was previously landed in #115837 and reverted. Re-landing with both
the server-side `_PREPROD_USECASE` and the client-facing upload options
endpoint using `TimeToIdle` consistently.

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components Trigger: Revert Add to a merged PR to revert it (skips CI)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants