You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
while true do
Sentry.configure_scope do |scope|
scope.set_transaction_name('foo')
p scope.transaction_names.size
end
end
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 a NoMemoryError 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:
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.
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: