getsentry / getsentry/sentry-python

Don't hold references to objects in telemetry pipeline

オープン
#5,582 コメント 1 件 リアクション 0 件 担当者 1 名 @sl0thentr0py が担当を希望しています GitHub で見る
Improvement Python Quality Improvement Span First
主要言語
Python
スター
2.2k
フォーク
669
平均マージ
1日 1時間
マージ済み PR(30日)
213

説明

## 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: [https://github.com/getsentry/sentry-python/issues/5274]()
* go panic: [https://github.com/getsentry/sentry-go/pull/1214]()
* python scrubber modifying user objects: [https://github.com/getsentry/sentry-python/pull/3409]()

## Decision

* eventually once everything is on attributes API (including errors), we will make sure `set_attribute` doesn'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_attribute` itself


This is a placeholder task to decide and investigate the references that the span first pipeline holds and try to clean that up.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。