rabbit_logger_exchange_h: Do not re-enter itself#14796
Merged
michaelklishin merged 2 commits intomainfrom Oct 23, 2025
Merged
Conversation
5ef0e1c to
7ae2236
Compare
[Why] Publishing a log message to an exchange might trigger other messages to be logged. This caused two issues: 1. the exchange logger re-entering itself in an infinite loop 2. if the message is logged from a gen_server-like process, like a Ra server, that is involved in the publishing code path, the process might call itself, leading to a blocked situation [How] The first issue is fixed with a variable stored in the process dictionary by the `log/2` function. This way, the function can check if it is called from itself because the first incantation stored a variable there. The second issue is fixed by publishing the message asynchronously from a separate process. This is ok because we don't care if the publish was successful or not. We re-use the process that was started initially to declare the exchange. Fixes #14069.
[Why] It makes debugging easier, especially now that this process does more than the initial setup: it acts as the actual publisher of the log messages.
7ae2236 to
73a41cc
Compare
ansd
approved these changes
Oct 23, 2025
michaelklishin
approved these changes
Oct 23, 2025
michaelklishin
added a commit
that referenced
this pull request
Oct 23, 2025
rabbit_logger_exchange_h: Do not re-enter itself (backport #14796)
ansd
added a commit
that referenced
this pull request
Oct 24, 2025
ansd
added a commit
that referenced
this pull request
Oct 24, 2025
(cherry picked from commit edc5f43)
ansd
added a commit
that referenced
this pull request
Oct 24, 2025
(cherry picked from commit edc5f43) (cherry picked from commit f9358588406b04ec5feeabe7539f55b616e7769e)
mergify bot
pushed a commit
that referenced
this pull request
Jan 19, 2026
Add a test enabling all stable feature flags with exchange logging enabled. This is a more general test case for https://github.com/rabbitmq/rabbitmq-server/discussions/11652 that should catch all future feature flag issues when `rabbit_ff_controller` publishes a message. Relates https://github.com/rabbitmq/rabbitmq-server/discussions/11652 https://github.com/rabbitmq/rabbitmq-server/discussions/14069 #14796 (cherry picked from commit e50a6bf)
mergify bot
pushed a commit
that referenced
this pull request
Jan 19, 2026
Add a test enabling all stable feature flags with exchange logging enabled. This is a more general test case for https://github.com/rabbitmq/rabbitmq-server/discussions/11652 that should catch all future feature flag issues when `rabbit_ff_controller` publishes a message. Relates https://github.com/rabbitmq/rabbitmq-server/discussions/11652 https://github.com/rabbitmq/rabbitmq-server/discussions/14069 #14796 (cherry picked from commit e50a6bf) (cherry picked from commit 3c80272)
Collaborator
|
FTR, this was backported to |
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.
Why
Publishing a log message to an exchange might trigger other messages to be logged. This caused two issues:
How
The first issue is fixed with a variable stored in the process dictionary by the
log/2function. This way, the function can check if it is called from itself because the first incantation stored a variable there.The second issue is fixed by publishing the message asynchronously from a separate process. This is ok because we don't care if the publish was successful or not. We re-use the process that was started initially to declare the exchange.
Fixes #14069.