You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Race condition on GraphicOptionsDefaultsExtensions.GetGraphicsOptions #1273
I have verified that I am running the latest version of ImageSharp
I have verified if the problem exist in both DEBUG and RELEASE mode
I have searched open and closed issues to ensure it has not already been reported
Description
Occasionally I'm getting the following exception which appears to be a threading race:
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Collections.Generic.Dictionary2.FindEntry(TKey key) at System.Collections.Generic.Dictionary2.TryGetValue(TKey key, TValue& value)
at SixLabors.ImageSharp.GraphicOptionsDefaultsExtensions.GetGraphicsOptions(Configuration configuration)
at SixLabors.ImageSharp.GraphicOptionsDefaultsExtensions.GetGraphicsOptions(IImageProcessingContext context)
at Iol.Content.Services.ImageMutationExtensions.<>c__DisplayClass0_1.b__3(IImageProcessingContext x) in /agent/work/7cdd69e844c80f2c/src/Iol.Content/Services/ImageMutationExtensions.cs:line 54
at SixLabors.ImageSharp.Processing.ProcessingExtensions.ProcessingVisitor.Visit[TPixel](Image1 image) at Iol.Content.Services.ImageMutationExtensions.Mutate(Image image, List1 imageCommands) in /agent/work/7cdd69e844c80f2c/src/Iol.Content/Services/ImageMutationExtensions.cs:line 65
Steps to Reproduce
I don't have a good repro. It happens once every hour or so with hundreds of container starts under 100k rpm image hosting. But I do think the fix is to just move to a ConcurrentDictionary.
System Configuration
ImageSharp version:
Other ImageSharp packages and versions:
Environment (Operating system, version and so on):
Activity
JimBobSquarePants commentedon Jul 13, 2020
What version are you using? You’ve checked the “I’m using the latest” box but that doesn’t reflect the possible stack trace for that feature
JimBobSquarePants commentedon Jul 13, 2020
See #1234
DTTerastar commentedon Jul 14, 2020
Sorry, Forgot that stupid Include Prereleases checkbox. I was on rc001, I'll try rc0003.
JimBobSquarePants commentedon Jul 14, 2020
Easy mistake to make 😄 RC0003 will have your fix in it.