Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can active Context scopes be closed in arbitrary order? #4081

Closed
mladedav opened this issue Jun 18, 2024 · 1 comment
Closed

Can active Context scopes be closed in arbitrary order? #4081

mladedav opened this issue Jun 18, 2024 · 1 comment
Labels
spec:context Related to the specification/context directory

Comments

@mladedav
Copy link

Relevant issue in Rust OpenTelemetry

Can active contexts overlap? Some implementations like Rust or Java provide methods to set a given context as an active context and return a scope which will restore the previous active context when dropped/closed.

Is there a requirement for the caller to close the scopes in reverse order, i.e. something like this should not happen:

// Root context is active
make context_1 active
make context_2 active
close context_1
// What context should be active now?
close context_2
// What context should be active now, presumably the root context?

Or should the implementations be ready for this scenario and handle it? Naive implementation of restoring the context that was active before the context being closed will break with this case. This implementation is currently used by Rust and is what I think Java does based on its documentation.

@mladedav mladedav added the spec:context Related to the specification/context directory label Jun 18, 2024
@mladedav
Copy link
Author

Sorry, I didn't find it in the spec but I've been just told elsewhere where it is stated.

Spec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec:context Related to the specification/context directory
Projects
None yet
Development

No branches or pull requests

1 participant