10000 [Messenger][FrameworkBundle] Add option to exclude stack trace from `ErrorDetailsStamp` by HypeMC · Pull Request #53454 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Messenger][FrameworkBundle] Add option to exclude stack trace from ErrorDetailsStamp #53454

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

Open
wants to merge 1 commit into
base: 7.3
Choose a base branch
from

Conversation

HypeMC
Copy link
Member
@HypeMC HypeMC commented Jan 7, 2024
Q A
Branch? 7.3
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #45944, #44943
License MIT

Some transports, in my case Beanstalk, don't like the large payloads that can result from the entire stack trace being in the ErrorDetailsStamp.

The idea of this PR is to allow excluding the stack trace through an option. The user could then optionally add a custom listener to log the stack trace to alternative storage.

@carsonbot carsonbot added this to the 7.1 milestone Jan 7, 2024
@HypeMC HypeMC force-pushed the option-to-not-include-stack-trace branch from 7c5a9e8 to d2851fd Compare January 7, 2024 20:49
@HypeMC HypeMC changed the title [Cache][FrameworkBundle] Add option to exclude stack trace from ErrorDetailsStamp [Messenger][FrameworkBundle] Add option to exclude stack trace from ErrorDetailsStamp Jan 7, 2024
@@ -1575,6 +1575,9 @@ function ($a) {
->defaultNull()
->info('Transport name to send failed messages to (after all retries have failed).')
->end()
->booleanNode('include_stack_trace_in_error')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too crazy about the name of the option, maybe someone has a better suggestion.

@HypeMC HypeMC force-pushed the option-to-not-include-stack-trace branch from d2851fd to c61849d Compare January 7, 2024 21:24
@odombrovskyi-dev
Copy link

Hi, thanks for preparing the fix for this issue. I have a few concerns regarding the solution though. If I get it right, with this option the message will lose pretty important info about an error.

From my understanding, the issue is not only in the big stack trace but also in the fact that the exception contains a previous exception and this previous exception has another previous exception. Eventually, after flattening the exception we could end up in having the stack trace processed from multiple exceptions, and for me this is what we should try to fix. Instead of flattening all previous exceptions, we should flatten only a current exception. This will allow us to keep the stack trace of the "latest" exception that will be useful to identify the error.

@HypeMC
Copy link
Member Author
HypeMC commented Feb 26, 2024

@odombrovskyi-dev Hi, as mentioned in the description, the idea here is to allow the user to implement their own listener and log the exception however they see fit. For example, they can log the entire error into Logstash and add a custom stamp that serves as an identifier connecting the message to the log. I guess I could remove the stack trace and just leave the exception, but that might prove useless in some cases, as a certain exception might get thrown from different places.

@HypeMC HypeMC force-pushed the option-to-not-include-stack-trace branch from c61849d to c08c143 Compare February 26, 2024 15:05
@xabbuh xabbuh modified the milestones: 7.1, 7.2 May 15, 2024
@HypeMC HypeMC force-pushed the option-to-not-include-stack-trace branch from c08c143 to be566c4 Compare August 11, 2024 14:12
@fabpot fabpot modified the milestones: 7.2, 7.3 Nov 20, 2024
@HypeMC HypeMC force-pushed the option-to-not-include-stack-trace branch from be566c4 to 8023a58 Compare January 2, 2025 21:20
@HypeMC HypeMC force-pushed the option-to-not-include-stack-trace branch from 8023a58 to 672d9be Compare January 20, 2025 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Messenger] Growing size of ErrorDetailsStamp breaks AMQP for RecoverableMessageHandlingException
6 participants
0