-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
Sentry::Scope#set_transaction_name
leaks memory
#2257
Labels
Comments
thx for the report, this whole transaction name stuff is a bit of mess at the moment. In general, there's no reason it needs to be an array, we just care about the last one anyway. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue Description
The method name
Sentry::Scope#set_transaction_name
suggests that it is a simple setter, but in fact it appends the specified name to an array. AFAICT this array is never popped/truncated, so if#set_transaction_name
is called e.g. in an event loop, the array will grow unlimited.I know that
Sentry.with_scope
is often a better solution inside a loop, but this is not always a feasible solution, e.g. if exceptions are rescued outside the loop.Reproduction Steps
Expected Behavior
The transaction names should not accumulate.
Actual Behavior
An ever increasing number is output, proving that the
Sentry::Scope#transaction_names
array keeps growing. Eventually aNoMemoryError
is raised.Ruby Version
3.2.3
SDK Version
5.15.0
Integration and Its Version
No response
Sentry Config
No response
The text was updated successfully, but these errors were encountered: