-
Notifications
You must be signed in to change notification settings - Fork 586
Open
Description
Problem
A recurring problem in SDKs is that we hold references to userland objects throughout the event pipeline (scope apply, scrubbing) and sometimes that causes
- data corruption (modify user state)
- race conditions in concurrent flows
There is no real need for us to risk holding references since all we need is to collect data reliably and without locks and blocking user flow.
Some examples of this problem:
- django user lazy object instantiation: Django ASGI: send_default_pii triggers request.user.is_authenticated sync access #5274
- go panic: fix(serialization): pre-serialize mutable event fields to prevent race panics sentry-go#1214
- python scrubber modifying user objects: Serialize vars early to avoid living references #3409
Decision
- eventually once everything is on attributes API (including errors), we will make sure
set_attributedoesn't hold direct references to userland state and reduce surface area of these races/data corruptions- this can be through a lazy delegation wrapper object as in my gist
- or just pre serialization in
set_attributeitself
This is a placeholder task to decide and investigate the references that the span first pipeline holds and try to clean that up.
Reactions are currently unavailable