-
Notifications
You must be signed in to change notification settings - Fork 241
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
OnEnding should make spans readonly, except within the processor. #1740
Comments
cc @pantuza |
Two ways this can be done: Java does it by storing the ID of the thread that runs OnEnding, and prevents any other thread from doing so. Go is going to setup a wrapper span that allows bypassing the span being read-only, and will be provided to the processor. |
👋 This issue 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 |
Should this be reported elsewhere? |
@dmathieu this is the appropriate place, though I am not sure this is the bug we will run into when our users start to make changes to the span. Span mutation methods leverage a In
That is where I think the real problem is. I assert that when a span processor attempts to mutate the underlying span, it will run into a thread deadlock situation. Has anyone implemented one of these processors in the wild yet? |
Hi folks, I agree that Probably, calling this processor method directly isn't desirable, but we are never fully aware of how users will use the library. Thus, might be necessary to protect this method individually. Does it make sense? @arielvalentin , I did not understand how the |
It's likely not a deadlock situation as much as an error. I am concerned that mutexes are not re-entrant. Assuming that is the case then when a span processor attempts to mutate it, then it will hit an additional synchronize block and that may result in errors. |
You are totally right! If any given I see two alternatives:
|
The OnEnding spec mentions:
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#onending
The current OnEnding implementation doesn't prevent the span from being modified in another thread, concurrently with the processor's action.
The text was updated successfully, but these errors were encountered: