Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Sharing violation on breadcrumbs files #1733

Closed
moozzyk opened this issue Apr 28, 2015 · 4 comments · Fixed by #1775
Closed

Sharing violation on breadcrumbs files #1733

moozzyk opened this issue Apr 28, 2015 · 4 comments · Fixed by #1775
Assignees
Milestone

Comments

@moozzyk
Copy link
Contributor

moozzyk commented Apr 28, 2015

I think we should catch the exception and retry n-times before failing.

Stack trace:

info    : [HelloWorld:IISExpress:CoreClr:x86] IncrementMessages called
error   : [Ntlm:IISExpress:CoreClr:x86] Unhandled Exception: System.IO.IOException: The process cannot access the file 'C:\ProgramData\Microsoft DNX\BreadcrumbS
tore\Microsoft.Framework.ConfigurationModel.Json.1.0.0-beta5-11252' because it is being used by another process.
error   : [Ntlm:IISExpress:CoreClr:x86]    at System.IO.Win32FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, F
ileOptions options, SECURITY_ATTRIBUTES secAttrs)
error   : [Ntlm:IISExpress:CoreClr:x86]    at System.IO.Win32FileSystem.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, Int32 bufferSiz
e, FileOptions options, FileStream parent)
error   : [Ntlm:IISExpress:CoreClr:x86]    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOp
tions options)
error   : [Ntlm:IISExpress:CoreClr:x86]    at Microsoft.Framework.Runtime.Servicing.Breadcrumbs.CreateBreadcrumbFile(String fileName)
error   : [Ntlm:IISExpress:CoreClr:x86]    at Microsoft.Framework.Runtime.Servicing.Breadcrumbs.WriteAllBreadcrumbsInternal()
error   : [Ntlm:IISExpress:CoreClr:x86]    at Microsoft.Framework.Runtime.Servicing.Breadcrumbs.<WriteAllBreadcrumbs>b__13_0(Object _)
error   : [Ntlm:IISExpress:CoreClr:x86]    at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
error   : [Ntlm:IISExpress:CoreClr:x86]    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
error   : [Ntlm:IISExpress:CoreClr:x86]    at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
error   : [Ntlm:IISExpress:CoreClr:x86]    at System.Threading.ThreadPoolWorkQueue.Dispatch()
error   : [Ntlm:IISExpress:CoreClr:x86]    at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
info    : [Ntlm:IISExpress:CoreClr:x86] Host process shutting down.
@pranavkm
Copy link
Contributor

pranavkm commented May 1, 2015

Should probably use ConcurrencyUtil.ExecuteLocked to start with.

@moozzyk
Copy link
Contributor Author

moozzyk commented May 1, 2015

Maybe - honestly I was not even aware of ExecuteLocked but it probably would not help in cases where the user calls dnu restore on the same app from two different prompts or would it?
This is not to say we should not use it if it helps in single dnu restore scenario

@pranavkm
Copy link
Contributor

pranavkm commented May 2, 2015

It does - it locks using a Semaphore for the specified path that is shared across multiple processes.

@moozzyk
Copy link
Contributor Author

moozzyk commented May 2, 2015

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants