Span#deep_dup is a shallow dup
I maintainer di solito rispondono entro 2 giorni
@sl0thentr0py ci sta già lavorando.
Dal 28/7/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Span#deep_dup (span.rb:245) is def deep_dup; dup; end. The copy shares @data, @tags, and @span_recorder with the original, so writing to the copy mutates the original.
Scope#dup calls it on every push_scope and every capture_event, so a "copied" scope holding a plain child span shares the parent's recorder.
Making it a real deep copy changes allocation behaviour on a hot path. Happy to open a PR to fix this once maintainers weigh in
Failing spec
Drop in sentry-ruby/spec/ and run bundle exec rspec spec/span_deep_dup_spec.rb. Both examples fail on master.
# Run from sentry-ruby/: bundle exec rspec path/to/span_deep_dup_spec.rb
require "spec_helper"
RSpec.describe "Span#deep_dup" do
before { perform_basic_setup { |config| config.traces_sample_rate = 1.0 } }
let(:span) do
transaction = Sentry.start_transaction(name: "t", op: "op")
transaction.start_child(op: "child")
end
it "does not share mutable state with the original" do
span.set_data("original", true)
copy = span.deep_dup
copy.set_data("written_via_copy", true)
expect(span.data).not_to have_key("written_via_copy")
end
it "gives the copy its own data, tags and span recorder" do
copy = span.deep_dup
aggregate_failures do
expect(copy.data).not_to be(span.data)
expect(copy.tags).not_to be(span.tags)
expect(copy.span_recorder).not_to be(span.span_recorder)
end
end
end
- Lingua principale
- Ruby
- Stelle
- 990
- Fork
- 552
- Merge medio
- 2g 16h
- PR unite (30g)
- 29
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di getsentry/sentry-ruby
-
Bug Ruby
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
getsentry/sentry-ruby#3211 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Events dropped client-side for size are only logged at debug level and not recorded as lostForse già presa @sentry-junior l’ha presa oggi. ApertaBug Junior: repro Ruby
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
getsentry/sentry-ruby#3209 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
with_child_span drops spans when blocks exit via break, return, or throwForse già presa @itsrayeedscodespace l’ha presa 1 giorno fa. ApertaBug Ruby Traces Waiting for: Product Owner
Difficoltà 2/5 1-3 ore Idoneità per principianti 38/100
getsentry/sentry-ruby#3206 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Let apps choose how the client IP on events is determinedForse già presa @sl0thentr0py l’ha presa 12 giorni fa. ApertaImprovement Ruby
getsentry/sentry-ruby#3180 · 2 commenti · 1 reazione · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
breaking change Next Major
Difficoltà 2/5 1-3 ore Idoneità per principianti 58/100
getsentry/sentry-ruby#3176 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di getsentry/sentry-ruby
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
internetee/registry#2984 ·
I maintainer di solito rispondono entro 6 giorni
-
interest-zsv
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
hitobito/hitobito_zsv#6 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
ecosyste-ms/issues#862 ·
I maintainer di solito rispondono entro 1 giorno
-
Redis Lua error `@user_script:52: ERR value is not an integer or out of range` when `window_size` is configuredForse già presa @mimosa l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
riscv/riscv-unified-db#2829 ·
I maintainer di solito rispondono entro 1 giorno