sentry-ruby icon indicating copy to clipboard operation
sentry-ruby copied to clipboard

Review hub management implementation

Open st0012 opened this issue 4 years ago • 6 comments
trafficstars

Related discussions:

  • https://twitter.com/solnic/status/1410539769495527432
  • https://github.com/dry-rb/dry-effects/issues/82#issuecomment-865162374

st0012 avatar Jul 02 '21 12:07 st0012

Found this because I was reviewing the code and surprised to see a thread local variable used. I would expect each Fiber, as a separate logical context and stack, to have a different hub, but I see this was done to solve some bug related to the way Rails uses Fibers? So maybe it needs to be an option...

singpolyma avatar Aug 04 '21 02:08 singpolyma

@singpolyma I'd like to give each fiber its own hub as well. But as long as users still use thread as a minimum concurrency unit instead of Fiber, it'll cause issues like #1374.

As for adding a fiber-based option, I don't plan to do that right now. But I'll revisit this issue when we start the implementation for version 5.0.

st0012 avatar Aug 06 '21 15:08 st0012

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Oct 28 '21 21:10 github-actions[bot]

we should revisit this when we implement the new hub-free scope system. fwiw, opentelemtry itself uses a fiber local, if I understand correctly

https://github.com/open-telemetry/opentelemetry-ruby/blob/ff9a7d3af31ad83ed6e07445a9e1609bec53d779/api/lib/opentelemetry/context.rb#L126-L128

sl0thentr0py avatar Jan 08 '24 16:01 sl0thentr0py