getsentry / sentry-dotnet

Sentry SDK for .NET
https://docs.sentry.io/platforms/dotnet
MIT License
594 stars 207 forks source link

Offline caching should support concurrent process instances #1067

Open bruno-garcia opened 3 years ago

bruno-garcia commented 3 years ago

Currently the CacheDirectoryPath property enabled offline caching of events, and the persistency of the "InstalationId" that uniquely identifies a device without any privacy concerns (it's a random ID so can't be related to any other information to identify a user across apps).

This path is used as a base, and a sub directory Sentry is created followed by a hash of the DSN (to make sure different apps using Sentry don't share any data).

One use case that is not covered is when multiple instances of the same app (so using the same DSN) are executed at the same time. Different SDK instances will race through accessing the caching directory.

The behavior we'd expect is:

bruno-garcia commented 1 year ago

Two past attempts to address this. Worth reading the PR reviews: