Skip to content

Fix stale StandardError-only framing, document critical errors - #987

Open
coipond-writer[bot] wants to merge 1 commit into
masterfrom
fix/error-handling-critical-errors-stale-standarderror-44795
Open

Fix stale StandardError-only framing, document critical errors#987
coipond-writer[bot] wants to merge 1 commit into
masterfrom
fix/error-handling-critical-errors-stale-standarderror-44795

Conversation

@coipond-writer

Copy link
Copy Markdown
Contributor

What

`Consumer-Groups/Error-Handling-and-Back-Off-Policy.md`'s opening Runtime section said your code "may raise any exception inherited from `StandardError`," and never mentioned a critical-errors category.

Why it's stale

As of Karafka 2.6.0, `base_consumer.rb:117,141` (`on_consume`/`on_after_consume`) rescue `Exception`, not just `StandardError` -- `ScriptError`/`SystemStackError` subclasses now go through the same retry flow.

Separately, `setup/config.rb:326` defines a distinct `critical_errors` category (default `[SystemExit, SignalException, NoMemoryError]`, configurable via `config.internal.processing.critical_errors`) that `dlq.rb:65-69` confirms is never dispatched to a DLQ regardless of retries, and instead triggers a graceful shutdown via `Instrumentation::CriticalErrorsListener`.

Both facts are already correctly described in `Upgrades-Karafka-2.6.md`, but were missing from this durable reference page -- the page a user on a later version would actually consult.

Fix

Fixed the opening framing and added a "Critical Errors" subsection.

Fixes #44795 (Redmine).

As of Karafka 2.6.0, base_consumer.rb:117,141 (on_consume/on_after_consume)
rescue Exception, not just StandardError - ScriptError and
SystemStackError subclasses now go through the same retry flow this
page describes, not just StandardError descendants.

Separately, setup/config.rb:326 defines a distinct critical_errors
category (default [SystemExit, SignalException, NoMemoryError],
configurable via config.internal.processing.critical_errors) that
dlq.rb:65-69 confirms is never dispatched to a DLQ regardless of
retries, and instead triggers a graceful shutdown via
Instrumentation::CriticalErrorsListener.

Both facts are already correctly described in Upgrades-Karafka-2.6.md,
but were missing from this durable reference page - the page a user on
a later version would actually consult. Fixed the opening framing and
added a Critical Errors subsection.

Fixes #44795.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

0 participants