Skip to content

use replace instead of insert to add extension#1

Closed
rasviitanen wants to merge 1 commit intoFishrock123:complete-refactor-traceidfrom
ConfiguraAB:path-bug
Closed

use replace instead of insert to add extension#1
rasviitanen wants to merge 1 commit intoFishrock123:complete-refactor-traceidfrom
ConfiguraAB:path-bug

Conversation

@rasviitanen
Copy link

@rasviitanen rasviitanen commented Mar 8, 2021

Great work at fixing some issues with this crate!

We are looking at moving to your fork due to the inactivity in the main repository.
This PR has to do with an issue when registering extensions, see original PR for more information:

inanna-malick#14

Please redirect me if I sumbitted this to the wrong branch.

Previously `ExtensionsMut::insert` was used without a
guarantee that we had exclusive access to a SpanRef's extensions.
This could lead to a panic in the `insert` function in the case where
the extension was inserted concurrently by multiple calls to `eval_ctx`.

By using `replace` the assertion is ignored and it no longer matters
whether we have exclusive access or not to a span in `eval_ctx`.
@rasviitanen rasviitanen closed this Mar 8, 2021
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