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

Restore randomly fails with An item with the same key has already been added. #2646

Closed
pranavkm opened this Issue Apr 22, 2016 · 7 comments

Comments

Projects
None yet
3 participants
@pranavkm
Member

pranavkm commented Apr 22, 2016

trace:    at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
trace:    at NuGet.ProjectModel.PackageSpecReferenceDependencyProvider.GetPackageSpecResolver(String rootPath)
trace:    at NuGet.ProjectModel.PackageSpecReferenceDependencyProvider.GetLibrary(LibraryRange libraryRange, NuGetFramework targetFramework, String rootPath)
trace:    at NuGet.DependencyResolver.RemoteDependencyWalker.FindProjectMatch(LibraryRange libraryRange, NuGetFramework framework, GraphEdge`1 outerEdge, CancellationToken cancellationToken)
trace:    at NuGet.DependencyResolver.RemoteDependencyWalker.<FindLibraryMatch>d__10.MoveNext()

Is there some sort of race condition at https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.ProjectModel/PackageSpecReferenceDependencyProvider.cs#L334 which needs to be guarded against?

@yishaigalatzer

This comment has been minimized.

Show comment
Hide comment
@yishaigalatzer

yishaigalatzer commented Apr 22, 2016

Version?

@pranavkm

This comment has been minimized.

Show comment
Hide comment
@pranavkm
Member

pranavkm commented Apr 22, 2016

@joelverhagen

This comment has been minimized.

Show comment
Hide comment
@joelverhagen

joelverhagen Apr 22, 2016

Member

I'm looking into this.

Member

joelverhagen commented Apr 22, 2016

I'm looking into this.

@joelverhagen joelverhagen self-assigned this Apr 22, 2016

@yishaigalatzer yishaigalatzer added this to the 3.5 Beta milestone Apr 22, 2016

@joelverhagen

This comment has been minimized.

Show comment
Hide comment
@joelverhagen

joelverhagen Apr 23, 2016

Member

Yes, there is a potential for a race condition here. We have a caching mechanism in a method that can be called from multiple threads simultaneously. That cache is a Dictionary. This should clearly be a ConcurrentDictionary.

Member

joelverhagen commented Apr 23, 2016

Yes, there is a potential for a race condition here. We have a caching mechanism in a method that can be called from multiple threads simultaneously. That cache is a Dictionary. This should clearly be a ConcurrentDictionary.

@joelverhagen

This comment has been minimized.

Show comment
Hide comment
@joelverhagen
Member

joelverhagen commented Apr 25, 2016

@pranavkm

This comment has been minimized.

Show comment
Hide comment
@pranavkm

pranavkm Apr 25, 2016

Member

Does the CLI need to pick up a new build of NuGet?

Member

pranavkm commented Apr 25, 2016

Does the CLI need to pick up a new build of NuGet?

@joelverhagen

This comment has been minimized.

Show comment
Hide comment
@joelverhagen

joelverhagen Apr 25, 2016

Member

Yes. @rrelyea, can someone (maybe me) bump the NuGet version in CLI to include this fix?

Member

joelverhagen commented Apr 25, 2016

Yes. @rrelyea, can someone (maybe me) bump the NuGet version in CLI to include this fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment