Repository navigation
fix: production Sentry triage — N+1s, admission lock hold, expected-error noise - #447
Merged
Merged
Conversation
Every session MCP request evaluated the two repository injection rules once per tool definition, 32 queries for one answer (PALAD-AI-RAILS-3K). The board_get_board_info tool loaded each column's workflow binding separately (PALAD-AI-RAILS-3E), and the personal list_sessions tool each session's admission (PALAD-AI-RAILS-30). Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
create_for_workflow_step held the installation-wide SessionAdmissionPolicy lock while it rendered instructions, created the session and attached its resources, which that lock's own contract forbids. finish_session waited up to 20 s behind it in production (PALAD-AI-RAILS-2Z). The session is now built under the step_run row lock alone and admitted in a second, short transaction. A run stopped in between cancels the built session, since the cancel fan-out has no admission to close for it; a retry after a crash between the two queues the session it finds. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
AixleBuilderController#start did not rescue the session-start preflight errors, so an expired agent login gave the user a 500 (PALAD-AI-RAILS-3C). It now redirects back with the message, as the API already answers with a 422. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
- An expired agent login refusing a step launch or an exec phase is the user's to renew and is shown on the step (PALAD-AI-TEMPORAL-S, -10). - A step launch for a run already cancelled is final, not retried five times (PALAD-AI-TEMPORAL-13). - A cancelled activity wrapped into an ApplicationError slipped past the interceptor's cancellation check (PALAD-AI-TEMPORAL-Z, -15..-18). - A phase failing after a stop was requested is the teardown, not a fault (PALAD-AI-TEMPORAL-1N). All of these are now raised with the BENIGN category. A permanent vendor refusal of an agent token refresh is reported as a warning rather than an error (PALAD-AI-TEMPORAL-1H); transient failures stay errors. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
The oldest admission wait was reported as an error every minute while the pool was draining normally, 879 events in PALAD-AI-RAILS-39. A long wait in a pool that keeps granting slots is now silent; a pool that has granted nothing for the threshold while a session waits is a warning naming the pool, its limit and occupancy. Both reports carry a fixed fingerprint. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
Merged
artempartos
added a commit
that referenced
this pull request
Oct 8, 2026
Adds the entries #441, #445 and #447 merged without, then moves [Unreleased] into 1.1.0. Minor, not patch: the release carries new features (comment editing, custom analytics range, Sessions & Runs sorting and date filters, /changelog, Managed by Aixle). Signed-off-by: Artem Petrov <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
artempartos
added a commit
that referenced
this pull request
Nov 18, 2026
) * fix(sessions): stop three Sentry false alarms from the session pipeline 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]> * perf: remove the N+1 queries Sentry flagged on runs, team picks and webhooks - 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]> --------- Signed-off-by: Artem Petrov <[email protected]> Co-authored-by: Claude Opus 5.5 <[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.
Summary
Production Sentry triage, 2026-10-08. 60 issues were unresolved. 42 are now closed in Sentry: 37 resolved (already fixed in 1.0.0, one-off
rails runnerscripts, deploy races) and 5 ignored as noise. This PR fixes the remaining 18, which group into five changes, one commit each:Tools::Context#repository_providers, one memoized queryboard_get_board_infoloaded each column's workflow binding separatelycolumn_workflow_binding: :workflow(also in the columns API)list_sessionsloaded each session's admissionincludes(:session_admission)finish_sessionwaited up to 20 s on the globalSessionAdmissionPolicylockcreate_for_workflow_stepbuilds the session under the step_run row lock only, then admits it in a short second transactionBENIGNcategory; a launch for a cancelled run is also no longer retriedRAILS-2Z: why the session build now runs outside the lock
SessionAdmissionService.transactiondocuments that nothing slow may run inside the lock, "no record save that touches half a dozen join tables".create_for_workflow_stepdid exactly that: rendered the instructions, created the session, resolved its config and attached resources. Now:step_runrow lock, so a retried launch never builds twice.WorkflowService#canceluses, so no new deadlock pair.The holder of the lock behind the production waits could not be confirmed, because the worker emits no transactions to Sentry. This change removes the one documented violation of that lock's contract. If waits continue, Postgres
log_lock_waitswould identify the holder.Test plan
origin/developand pass here.After deploy, resolve these by hand: Sentry's commit integration points at
palad-ai/palad-app, soFixeskeywords here will not close them.RAILS-3K, -3D, -3E, -34, -30, -2Z, -3C, -39; TEMPORAL-S, -10, -13, -Z, -15, -16, -17, -18, -1N, -1H.
🤖 Generated with Claude Code