Skip to content

CI dry run: isolate inherited hubs under :fiber - #1

Closed
SeanLF wants to merge 2 commits into
masterfrom
fix/fiber-hub-inherited-storage
Closed

CI dry run: isolate inherited hubs under :fiber#1
SeanLF wants to merge 2 commits into
masterfrom
fix/fiber-hub-inherited-storage

Conversation

@SeanLF

@SeanLF SeanLF commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Internal CI verification before opening upstream. Do not merge.

SeanLF and others added 2 commits July 25, 2026 21:56
Fiber storage is inherited by child fibers and by threads started from
them, handing over the same Hub object rather than a copy. Under
hub_isolation_level = :fiber that left sibling request fibers and worker
threads sharing one hub, and one unsynchronized scope stack, so
concurrent requests and jobs read each other's tags. The `|| clone`
fallback never fired because the inherited value was not nil.

Tag each stored entry with its owning fiber so a context that inherited
one takes its own copy. The copy keeps the live span: Scope#dup
deep-copies it, and spans recorded on a detached transaction copy are
never sent, which would break the Async fan-out this mode exists for.

Reported by @trevorturk in getsentry#3018.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The fiber-storage gem polyfills Fiber[] on Ruby < 3.2 and on JRuby, so
:fiber is active there too, but the polyfill does not inherit into
Thread.new. A thread started from a fiber therefore begins from the main
hub and cannot stay on the parent's trace, which the thread half of this
expectation assumed it could.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@SeanLF

SeanLF commented Jul 26, 2026

Copy link
Copy Markdown
Owner Author

CI dry run complete: 148 checks pass on the full matrix. Superseded by getsentry#3036.

@SeanLF SeanLF closed this Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant