Skip to content

Conversation

@williazz
Copy link
Contributor

Summary

Warning: do not merge until I have completed the migration work for opentelemetry-swift

Swift 6.0 adds some concurrency checks. This was some bitter work but I completed the migration work for core.

Implementation

  1. Add @unchecked Sendable to pretty much every class
  2. Upgrade semantic-conventions/generate.sh to use Sendable protocol

Testing

I removed the strict checks on test code to keep code changes minimal. I still need to do some manual end-to-end testing to get some more confidence.

XCTAssert(ActivityContextManager.instance.getCurrentContextValue(forKey: .span) === span1)
let expec = expectation(description: "testStartAndEndSpanInAsyncQueue")
DispatchQueue.global().async {
let span2 = self.createSpan(parentSpan: span1, name: "testStartAndEndSpanInAsyncQueue2")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create span and endSpanAndValidateContext not only start and end the span but also validate the active span before and after running, and that is not being done now. We should keep calling them as that validation is very key for the tests, probably the methods need updating to something like:
static nonisolated func createSpan( tracer: DefaultTracer, parentSpan: Span, name: String) static nonisolated func endSpanAndValidateContext(span: Span, parentSpan: Span?)
And be called properly, even wrapping the passing span in a Mutex or using the Locked class from the SDK that allows similar functionality to Mutex

@nachoBonafonte
Copy link
Member

Except for that detail with the tests all the rest looks really good, you have done a great work.

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.

2 participants