Repository navigation
Conversation
DefaultLogger logs the whole context hash with Sneakers.logger.warn. That hash includes delivery_info, which references the Bunny channel and connection. With a stock Logger the hash is only interpolated into a string, which is cycle-safe. A structured logger that serializes the payload (e.g. as_json, as SemanticLogger's JSON formatter does) recurses through the cyclic graph until it raises SystemStackError, which takes down the consumer thread. Drop :delivery_info from what DefaultLogger logs. The context hash passed to custom error reporters is unchanged.
ganey
force-pushed
the
dont-log-delivery-info
branch
from
October 17, 2026 20:11
08ea8d2 to
427742e
Compare
Member
Member
|
I suggest changing Bunny like so ruby-amqp/bunny#755 instead. |
Member
|
Let's continue in the Bunny PR for now. I will look into the one configuration CI failure soon, it's not mergeable yet. Sorry. |
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.
Sneakers::ErrorReporter::DefaultLogger#calldoesSneakers.logger.warn(context_hash), andWorker#process_workputsdelivery_infoin that hash.delivery_inforeferences the Bunnychannel, which references the connection, which references the channel
again.
With the default
Logger+ProductionFormatterthis is harmless: thehash is interpolated into a string, and
Hash#to_shandles cycles. Witha structured logger that serializes the payload, such as
SemanticLogger's JSON formatter calling
as_json, it recurses untilSystemStackError. We hit this in production on a worker whose handlerraised; the consumer died and the queue sat at 0 consumers.
This drops
:delivery_infofrom whatDefaultLoggerlogs. The hashpassed to custom reporters is unchanged, so reporters that use
delivery_infokeep working.Added a spec with a cyclic
delivery_info; it fails without the change.