-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ITrace: Fixes concurrency of cache. #2314
ITrace: Fixes concurrency of cache. #2314
Conversation
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using Microsoft.Azure.Cosmos.Json; | ||
|
||
internal static partial class TraceWriter | ||
{ | ||
private static readonly Dictionary<string, string> FilePathToName = new Dictionary<string, string>(); | ||
private static readonly ConcurrentDictionary<string, string> FilePathToName = new ConcurrentDictionary<string, string>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's avoid regressing this, please add a test using concurrent tasks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A test would also discover any other thread-unsafe operations that could be happening.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Samer Boshra <sboshra@microsoft.com>
ITrace: Fixes concurrency of cache.
Description
Makes the cache concurrent.