Skip to content

fix(sentry): drop enable_logs from the Temporal worker Sentry.init - #253

Merged
artempartos merged 1 commit into
developfrom
fix/temporal-worker-sentry-7-boot
Sep 12, 2026
Merged

artempartos merged 1 commit into
developfrom
fix/temporal-worker-sentry-7-boot

Conversation

@artempartos

Copy link
Copy Markdown
Contributor

What broke

Every worker-ruby pod in production is in CrashLoopBackOff, failing at boot:

bin/temporal_worker:22:in 'block in <main>': undefined method 'enable_logs=' for an instance of Sentry::Configuration (NoMethodError)

    config.enable_logs = true
	from /usr/local/bundle/gems/sentry-ruby-7.0.0/lib/sentry-ruby.rb:266:in 'Sentry.init'

sentry-ruby 7.0.0 removed enable_logs. #242 migrated config/initializers/sentry.rb for
it, but bin/temporal_worker calls Sentry.init a second time — with its own
Settings.sentry.temporal_dsn, after config/environment — and that call still carried the
flag.

assets:precompile never loads bin/temporal_worker, so the image built green and the
failure surfaced only in the cluster.

Why it looked like a concurrency-limit problem

No worker polls the Temporal task queue, so workflow_execution_workflow_v2 never starts and
every WorkflowRun created after the rollout stays in pending — no TerminalSession row,
no admission, nothing for the queue to grant. On screen that reads as sessions stuck waiting
for capacity.

Production, project 27, at the time of diagnosis:

pool project:27 limit=20, occupied=6, queued=0
SessionConcurrencyLimit max_sessions=20
policy enabled=true, paused=false
WorkflowRun running 4
WorkflowRun pending 5, oldest 2026-09-12T12:54:47Z

12:54 is the minute the sentry-7 image finished rolling out; the last run that started was
12:53:50. The admission queue was never the constraint.

Second-order damage while the worker is down: SessionAdmissionReconciler does not run
either — cleanup_lag_seconds: 807, uncertain_operations: 23, pinned_reservations: 2.
Those should clear on their own once the worker is back.

The change

Drop the line. Under 7.0 logs are unconditionally on, and this Sentry.init sets no
enabled_patches, so the :logger patch that would turn the worker's own log output into
Sentry log events stays off — same as before.

🤖 Generated with Claude Code

sentry-ruby 7.0.0 removed `enable_logs`, and #242 migrated
config/initializers/sentry.rb for it — but bin/temporal_worker calls
Sentry.init a second time, with its own DSN, after config/environment.
That call kept the flag, so the worker raised NoMethodError from inside
Sentry.init and died on boot.

Nothing but the initializer is loaded by `assets:precompile`, so the
image built green and the failure only appeared in the cluster: every
worker-ruby pod hit CrashLoopBackOff, no one polled the Temporal task
queue, and every WorkflowRun created afterwards sat in `pending`
indefinitely — which reads on screen as sessions waiting on a
concurrency limit that is nowhere near full.

No behaviour to preserve: under 7.0 logs are unconditionally on, and
this init sets no enabled_patches, so the `:logger` patch that would
turn the worker's own log output into Sentry log events stays off.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
@artempartos
artempartos merged commit 05ce5d7 into develop Sep 12, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant