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
This is the issue tracking the fix. The other issue has lots of engagement and I want to avoid closing it before getting a confirmation that the issues have been fixed.
The Directory.CreateDirectory & Directory.Move methods do not guarantee thread safety. They merely guarantee filesystem consistency.
Through my tests I narrowed down the issue to Directory.Move not throwing every time when the dest path exists in the case where multiple threads are trying to create the same directory. Directory.Move never claims thread safety, but rather only filesystem consistency. Effectively on Linux we’d have multiple moves succeed, because the underlying “rename” syscall allows for the destdir to be overridden.
The text was updated successfully, but these errors were encountered:
nkolev92
changed the title
Threading issues with DirectoryUtility.CreateSharedDirectory
Threading issues with DirectoryUtility.CreateSharedDirectory cause failures in restore/pack
Apr 22, 2019
nkolev92
changed the title
Threading issues with DirectoryUtility.CreateSharedDirectory cause failures in restore/pack
Threading issues with DirectoryUtility.CreateSharedDirectory cause failures in restore/pack on Linux/Mac
Apr 22, 2019
Likely root cause of #7341.
This is the issue tracking the fix. The other issue has lots of engagement and I want to avoid closing it before getting a confirmation that the issues have been fixed.
NuGet/NuGet.Client#2795
During the investigation of #7908, I found that this utility has threading issues. I have a test app that reliably repros the behavior: https://github.com/nkolev92/NuGet.Tools/tree/master/DirectoryUtilityRepro/TestApp
The Directory.CreateDirectory & Directory.Move methods do not guarantee thread safety. They merely guarantee filesystem consistency.
Through my tests I narrowed down the issue to Directory.Move not throwing every time when the dest path exists in the case where multiple threads are trying to create the same directory. Directory.Move never claims thread safety, but rather only filesystem consistency. Effectively on Linux we’d have multiple moves succeed, because the underlying “rename” syscall allows for the destdir to be overridden.
The text was updated successfully, but these errors were encountered: