fix(context): do not modify stack array directly when attach and detach#1760
fix(context): do not modify stack array directly when attach and detach#1760tientt-holistics wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
|
|
|
Hi @tientt-holistics, thank you for your contribution! It looks like there's a few failures related to Rubocop in the CI: https://github.com/open-telemetry/opentelemetry-ruby/actions/runs/11834674510/job/33062312585?pr=1760#step:6:267 Could you take a look? |
cd841ef to
4058a91
Compare
|
Hi @kaylareopelle, I just fixed the rubocop warning. But I don't know how to trigger the workflow again. Could you mind help me do that? Thank you |
|
Hi @tientt-holistics, thanks for the fix! Since this is your first PR in this repository, a maintainer or an approve will need to approve your CI runs. I just kicked them off again. If you're ever stuck waiting after a commit, post a comment and someone should be able to approve the runs soon after. |
|
I have added some details to an issue for reviewers: #1766 My concern here is that switching to using Immutable Arrays results in additional object allocations per |
|
This approach requires additional allocations, as @arielvalentin noted. I implemented an alternative with a linked list back in February: #1597. I rejected that due to performance concerns, however when I repeat the benchmarks with this PR, the immutable array approach is consistently worse: |
|
An alternative using the existing array code with a Fiber attribute, like |
|
Another option, if we're willing to take a dependency on |
@arielvalentin pointed out that this uses fiber-local variables in its implementation, so it suffers from the same problem of other gems breaking encapsulation and copying the contents of the Fiber local entries. |
|
👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the |
|
👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the |
|
Definitely still an issue, robot. |
As mentioned in open-telemetry/opentelemetry-ruby/pull/1598
This PR will replace the
stack.pushandstack.popwith Thread.current assignment