Skip to content

fix(seer): Pre-filter night-shift schedule by SeerProjectRepository#114451

Merged
trevor-e merged 4 commits intomasterfrom
telkins/fix-night-shift-cron-timeout
Apr 30, 2026
Merged

fix(seer): Pre-filter night-shift schedule by SeerProjectRepository#114451
trevor-e merged 4 commits intomasterfrom
telkins/fix-night-shift-cron-timeout

Conversation

@trevor-e
Copy link
Copy Markdown
Member

The daily schedule_night_shift cron was iterating every active org and running a 3-feature batch_has_for_organizations check against each one, which fans out a per-org subscription RPC inside the flagpole evaluator. The fanout exceeded the 15-minute task deadline, so the cron never reached schedule_complete and never dispatched any per-org workers.

Restrict the candidate set up front to orgs that have at least one project with a SeerProjectRepository — the prerequisite for any night-shift work — then run the existing feature flag gate over that much smaller set. Repo rows can outlive a paid Seer subscription, so the feature flag check stays.

Fixes SENTRY-5NQ2

The daily schedule_night_shift cron was iterating every active org and
running a 3-feature batch_has_for_organizations check against each one,
which fans out a per-org subscription RPC inside the flagpole evaluator.
For Sentry-scale org counts that fanout exceeded the 15-minute task
processing deadline, so the cron never reached the schedule_complete log
and never dispatched any per-org workers.

Restrict the candidate set up front to orgs that have at least one
project with a SeerProjectRepository (the prerequisite for any
night-shift work), then run the existing feature flag gate over that
much smaller set. The repo rows can outlive a paid Seer subscription, so
the feature flag check is still required.

Fixes SENTRY-5NQ2
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 30, 2026
trevor-e and others added 2 commits April 30, 2026 13:49
The pre-filter shrinks the org set ~10x but still leaves ~12.5k orgs in
the per-org subscription RPC fanout under feature flag eval. Bumping the
processing deadline to 30 minutes — matching the sibling
schedule_context_engine_indexing_tasks task in the same namespace —
gives ~2x headroom against transient cell-side slowness.

Refs SENTRY-5NQ2
Co-Authored-By: Claude <noreply@anthropic.com>
@trevor-e trevor-e marked this pull request as ready for review April 30, 2026 20:23
@trevor-e trevor-e requested a review from a team as a code owner April 30, 2026 20:23
@trevor-e trevor-e merged commit b039c4b into master Apr 30, 2026
59 checks passed
@trevor-e trevor-e deleted the telkins/fix-night-shift-cron-timeout branch April 30, 2026 20:38
cleptric pushed a commit that referenced this pull request May 5, 2026
…114451)

The daily `schedule_night_shift` cron was iterating every active org and
running a 3-feature `batch_has_for_organizations` check against each
one, which fans out a per-org subscription RPC inside the flagpole
evaluator. The fanout exceeded the 15-minute task deadline, so the cron
never reached `schedule_complete` and never dispatched any per-org
workers.

Restrict the candidate set up front to orgs that have at least one
project with a `SeerProjectRepository` — the prerequisite for any
night-shift work — then run the existing feature flag gate over that
much smaller set. Repo rows can outlive a paid Seer subscription, so the
feature flag check stays.

Fixes SENTRY-5NQ2

---------

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants