Repository navigation
fix: Sentry triage — session pipeline false alarms and N+1 queries - #773
Merged
Merged
Conversation
PALAD-AI-TEMPORAL-2A: a cleanup whose Kubernetes API call timed out was wrapped as a non-retryable failure, skipping both the activity's retry policy and the workflow's cleanup timer, and was left to the reconciler. A transient API error (no status, 429, 5xx, refused or reset connection) now returns the pass as pending, like a delete still in progress. PALAD-AI-TEMPORAL-29: the launch re-check raises a credential preflight refusal before any phase runs, outside ContainerService::PhaseError, so the benign check from #447 never saw it. Every preflight refusal is now benign, in one list shared with SessionLaunchRelay. PALAD-AI-RAILS-3S: the queue health check and the reconciler's drain both tick on the minute; a slot released just before the check read as free capacity nobody was granting. A slot released in the last two minutes now counts as live. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
…ebhooks - PALAD-AI-RAILS-4N, 4G: WorkflowService.create looked up and created each step run one by one, three queries per step, on every launch. The run was saved a line earlier, so the lookup never found anything: one insert_all and one counter update now. - PALAD-AI-RAILS-4M: a team pick checked project access and read the member's default runtime with queries per member, while holding the team row lock. Project#accessible_user_ids answers access for the whole team in two queries; the default runtime comes from the credentials already loaded. - PALAD-AI-RAILS-4J: a Jira or Linear app webhook updated each matched subscription's heartbeat separately; one update_all now. - PALAD-AI-RAILS-4H, 4F: the admin projects index did not preload owner and company, and a board task's runs did not preload their workflows. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend half of the 2026-11-18 Sentry triage. The frontend half is a separate PR.
Errors
HttpErrorwith no status) was wrapped as non-retryable, skipping the activity's retry policy and the workflow's 15 s cleanup loop, and the slot waited for the reconciler.ContainerRuntime#transient_error?(Kubernetes: no status, 429, 5xx, refused/reset connection). A transient error incleanupreturns the pass ascleanup_pending, the same as an unfinished delete.SessionService.revalidate_admission!raisesAgentCredential::PreflightErrorbefore any phase runs, outsideContainerService::PhaseError, so #447's benign check never saw it.SessionService::PREFLIGHT_REFUSALSis shared withSessionLaunchRelay, which already treated them as expected.DRAIN_GRACE) count as live. A slot that stays unreleased after its session ended still warns.N+1 queries
WorkflowService.create:find_or_create_by!per step, so 3 queries per step on every launchStepRun.insert_all!+increment!(:step_runs_count). The run was saved one line earlier, so the lookup could never find anything.StepRunhas no create callbacks.ProjectTeams::Picker:accessible_by?anddefault_agent_runtimeran per member while holding the team row lockProject#accessible_user_ids: 2 queries for the whole team. The default runtime is read from the credentials the picker already loads.UPDATEper matched subscriptionupdate_allowner/company; stop skippingworkflowon nested runs (a task's runs can come from several workflows)Not changed, with reason
/webhooks/in/%00) is already fixed by fix: promote a running step's outputs; answer 400 to a NUL byte in the URL #770 and unreleased.terminal_sessionsonmcp) lines up with deploy windows and whole-DB slowness. An index won't help.Tests
New tests cover each fix: activity cleanup with an API timeout vs a 403, the re-check refusal being benign,
transient_error?, the drain grace window, picker query count independent of team size,accessible_user_idsagreeing withaccessible_by?, step-run creation order/state/counter with a step-independent query count, a single heartbeat write for three matched subscriptions, and admin index/show under Bullet with several projects/workflows. The admin tests fail withBullet::Notification::UnoptimizedQueryErrorwithout the fix.Locally, the touched test files pass, and rubocop and brakeman are clean. CI is the full-suite verification.
Unrelated, found on the way:
test/integration/hosted_runtime_unchanged_test.rbfails on cleandevelopwhen run alone. A first-use schema query (pg_indexforrunner_operations) lands inrunner_gateway_querieswhen the schema cache is cold.🤖 Generated with Claude Code