Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

fix/internal/observation: make ErrCollector type threadsafe#63496

Merged
ggilmore merged 1 commit into
mainfrom
graphite-ggilmorefix_internal_observation_make_errcollector_type_threadsafe
Jul 3, 2024
Merged

fix/internal/observation: make ErrCollector type threadsafe#63496
ggilmore merged 1 commit into
mainfrom
graphite-ggilmorefix_internal_observation_make_errcollector_type_threadsafe

Conversation

@ggilmore

@ggilmore ggilmore commented Jun 26, 2024

Copy link
Copy Markdown
Contributor

Closes https://linear.app/sourcegraph/issue/SRC-410/race-in-gitserver-observability

This PR adds a mutex to the internal/observation.ErrCollector type that makes it safe to use across multiple goroutines.

(This could quite easily happen, as the FinishFunc's OnCancel method runs the logic that accesses/modifies ErrReporter in a separate goroutine:)

https://github.com/sourcegraph/sourcegraph/blob/fa46a26f7a7d3d13833cc7917aaee42d1c94eff9/internal/observation/observation.go#L156-L170

Test plan

CI now passes and doesn't report race conditions

Changelog

  • Fixed a threadsafety issue in the internal/observation.ErrCollector type

@cla-bot cla-bot Bot added the cla-signed label Jun 26, 2024
@github-actions github-actions Bot added team/product-platform team/source Tickets under the purview of Source - the one Source to graph it all labels Jun 26, 2024

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @ggilmore and the rest of your teammates on Graphite Graphite

@ggilmore ggilmore marked this pull request as ready for review June 26, 2024 19:01
@eseliger

eseliger commented Jul 2, 2024

Copy link
Copy Markdown
Member

@ggilmore is this ready for review? It's open but no reviewers requested yet :)

@ggilmore ggilmore requested a review from a team July 3, 2024 08:07
@ggilmore

ggilmore commented Jul 3, 2024

Copy link
Copy Markdown
Contributor Author

@eseliger whoops sorry, I just added y'all

@graphite-app

graphite-app Bot commented Jul 3, 2024

Copy link
Copy Markdown

TV gif. We look up at Rowan Atkinson as Mr. Bean wearing medical scrubs. He pulls down a surgical mask, gives a gloved thumbs up, and smiles maniacally. (Added via Giphy)

@ggilmore ggilmore merged commit 07beefe into main Jul 3, 2024
@ggilmore ggilmore deleted the graphite-ggilmorefix_internal_observation_make_errcollector_type_threadsafe branch July 3, 2024 18:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/product-platform team/source Tickets under the purview of Source - the one Source to graph it all

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants