-
Notifications
You must be signed in to change notification settings - Fork 4k
rabbit_logger_exchange_h: Do not re-enter itself #14796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
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)
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.