Skip to content

Improve flushTrace atomicity - #45

Merged
ladd merged 5 commits into
mainfrom
lvt-root-span-end
Nov 4, 2025
Merged

Improve flushTrace atomicity#45
ladd merged 5 commits into
mainfrom
lvt-root-span-end

Conversation

@ladd

@ladd ladd commented Nov 4, 2025

Copy link
Copy Markdown
  • Fix a race where the root span could be ended twice, causing an assert.
  • Give root span a public getter.
  • Fix a rare boundary condition in sampling.
  • Add a local-only statistical test for sampling.
  • Lint.

@bachand
@jparise

@ladd
ladd merged commit 7da7750 into main Nov 4, 2025
4 checks passed
@ladd
ladd deleted the lvt-root-span-end branch November 4, 2025 00:31

@bachand bachand left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks @ladd . LGTM! Nice work.


public func end() {
assert(endTime == nil)
assert(endTime == nil, "span \(name) was ended more than once")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

XCTAssert(sampler2.shouldSample) // should be true with the new GUID
}

func testStableGuidSamplerSampleRates() throws {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💪

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.

3 participants