Skip to content

Use Random.Shared instead of instantiating Random#243

Merged
bruno-garcia merged 1 commit intomainfrom
seer/use-random-shared
Aug 28, 2025
Merged

Use Random.Shared instead of instantiating Random#243
bruno-garcia merged 1 commit intomainfrom
seer/use-random-shared

Conversation

@seer-by-sentry
Copy link
Contributor

Fixes SYMBOL-COLLECTOR-SERVER-BC. The issue was that: Concurrent InMemorySymbolService.Store calls generate identical temporary file paths due to non-thread-safe Random instance, causing file access conflicts.

This change replaces the instantiation of a new Random object with the use of Random.Shared to generate random numbers. This is more efficient as it avoids the overhead of creating a new Random object each time a random number is needed.

This fix was generated by Seer in Sentry, triggered by bruno@sentry.io. 👁️ Run ID: 1049720

Not quite right? Click here to continue debugging with Seer.

@bruno-garcia bruno-garcia marked this pull request as ready for review August 27, 2025 18:24
@bruno-garcia
Copy link
Member

Thanks Sentry, finally someone solves bugs from this code base 😅

@bruno-garcia bruno-garcia merged commit d72b5b1 into main Aug 28, 2025
8 checks passed
@bruno-garcia bruno-garcia deleted the seer/use-random-shared branch August 28, 2025 00:24
@bruno-garcia
Copy link
Member

image

Verified Seer indeed fixed this issue btw!

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.

1 participant