Skip to content

idtui: fix data race in TestTelemetry#10528

Merged
vito merged 1 commit into
dagger:mainfrom
vito:telemetry-test-data-race
Jun 4, 2025
Merged

idtui: fix data race in TestTelemetry#10528
vito merged 1 commit into
dagger:mainfrom
vito:telemetry-test-data-race

Conversation

@vito
Copy link
Copy Markdown
Contributor

@vito vito commented Jun 4, 2025

This is just the minimum viable change to fix the data race on main.

We currently lock in the user of the dagui.DB instead of in the dagui.DB itself; in practice this race doesn't occur since it's guarded by the mutex in the Frontend.

It could be worth considering pushing this down into the DB but I've been here before and previously decided it's better to let the DB consume things as fast as possible and trust the caller to synchronize more coarsely.

So, this change just continues the status quo and adds a lock to the OTLP receiver in the tests.

This is just the minimum viable change to fix the data race on `main`.

We currently lock in the _user_ of the `dagui.DB` instead of in the
`dagui.DB` itself; in practice this race doesn't occur since it's
guarded by the mutex in the `Frontend`.

It could be worth considering pushing this down into the `DB` but I've
been here before and previously decided it's better to let the `DB`
consume things as fast as possible and trust the caller to synchronize
more coarsely.

So, this change just continues the status quo and adds a lock to the
OTLP receiver in the tests.

Signed-off-by: Alex Suraci <alex@dagger.io>
@vito vito merged commit a5525e8 into dagger:main Jun 4, 2025
56 checks passed
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