{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3198","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3198/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3198/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/3198/events","html_url":"https://github.com/Microsoft/TypeScript/issues/3198","id":77651957,"number":3198,"title":"VS 2013 hangs when building in parallel process TS files","user":{"login":"wgebczyk","id":1898040,"avatar_url":"https://avatars.githubusercontent.com/u/1898040?v=3","gravatar_id":"","url":"https://api.github.com/users/wgebczyk","html_url":"https://github.com/wgebczyk","followers_url":"https://api.github.com/users/wgebczyk/followers","following_url":"https://api.github.com/users/wgebczyk/following{/other_user}","gists_url":"https://api.github.com/users/wgebczyk/gists{/gist_id}","starred_url":"https://api.github.com/users/wgebczyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wgebczyk/subscriptions","organizations_url":"https://api.github.com/users/wgebczyk/orgs","repos_url":"https://api.github.com/users/wgebczyk/repos","events_url":"https://api.github.com/users/wgebczyk/events{/privacy}","received_events_url":"https://api.github.com/users/wgebczyk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Visual%20Studio","name":"Visual Studio","color":"007ACC"}],"state":"closed","locked":false,"assignee":{"login":"CyrusNajmabadi","id":4564579,"avatar_url":"https://avatars.githubusercontent.com/u/4564579?v=3","gravatar_id":"","url":"https://api.github.com/users/CyrusNajmabadi","html_url":"https://github.com/CyrusNajmabadi","followers_url":"https://api.github.com/users/CyrusNajmabadi/followers","following_url":"https://api.github.com/users/CyrusNajmabadi/following{/other_user}","gists_url":"https://api.github.com/users/CyrusNajmabadi/gists{/gist_id}","starred_url":"https://api.github.com/users/CyrusNajmabadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CyrusNajmabadi/subscriptions","organizations_url":"https://api.github.com/users/CyrusNajmabadi/orgs","repos_url":"https://api.github.com/users/CyrusNajmabadi/repos","events_url":"https://api.github.com/users/CyrusNajmabadi/events{/privacy}","received_events_url":"https://api.github.com/users/CyrusNajmabadi/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/8","html_url":"https://github.com/Microsoft/TypeScript/milestones/TypeScript%201.6","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/8/labels","id":900034,"number":8,"title":"TypeScript 1.6","description":"","creator":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars.githubusercontent.com/u/8000722?v=3","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"open_issues":72,"closed_issues":210,"state":"open","created_at":"2014-12-11T05:46:12Z","updated_at":"2015-08-13T16:50:02Z","due_on":null,"closed_at":null},"comments":18,"created_at":"2015-05-18T13:13:20Z","updated_at":"2015-08-13T16:50:02Z","closed_at":"2015-08-13T16:50:02Z","body":"### Context\r\nI have solution with multiple CsProj files. Each project has multiple TypeScript files that are generated to single JS and .d.ts.\r\nNo \"Core\" projects reference \"Core.d.ts\". The build is triggered from command line in same time, when solution is opened in Visual Studio.\r\n\r\n\r\n### Result\r\nFrom time to time VS hangs with \"Visual Studio is Busy\" from tray icon message.\r\n\r\n\r\n### Observations\r\nThis is frequently reproducible. It seems to be related to the fact, that VS/TS detects that \"Core.d.ts\" has been removed (as part of gulp build step)\r\nand recreated. In VS I can observe lot of errors appear and after some time disapear.\r\n\r\nWhen attached in debugger I can see:\r\n\r\n1. \"!mwaits\" shows that thread 18 has [SyncBlock] LockType. and callstack:\r\n```\r\n0:018> !clrstack\r\nOS Thread Id: 0x56d4 (18)\r\nChild SP       IP Call Site\r\n12a3f0ac 775f013d [GCFrame: 12a3f0ac] \r\n12a3f184 775f013d [GCFrame: 12a3f184] \r\n12a3f1a0 775f013d [HelperMethodFrame_1OBJ: 12a3f1a0] System.Threading.Monitor.ReliableEnter(System.Object, Boolean ByRef)\r\n12a3f21c 504b2620 Microsoft.VisualStudio.Services.FileChangeService.AdviseFileChange(System.String, Microsoft.VisualStudio.Shell.Interop._VSFILECHANGEFLAGS, Microsoft.VisualStudio.Shell.Interop.IVsFileChangeEvents)\r\n12a3f258 504c459a Microsoft.VisualStudio.Services.FileChangeService+<>c__DisplayClass5.<Microsoft.VisualStudio.Shell.Interop.IVsFileChangeEx.AdviseFileChange>b__2()\r\n12a3f264 7790627b Microsoft.VisualStudio.ErrorHandler+<>c__DisplayClass1.<CallWithCOMConvention>b__0()\r\n12a3f268 77900044 Microsoft.VisualStudio.ErrorHandler.CallWithCOMConvention(System.Func`1<Int32>, Boolean, Boolean)\r\n12a3f29c 77906265 Microsoft.VisualStudio.ErrorHandler.CallWithCOMConvention(System.Action, Boolean)\r\n12a3f2b0 504b239b Microsoft.VisualStudio.Services.FileChangeService.Microsoft.VisualStudio.Shell.Interop.IVsFileChangeEx.AdviseFileChange(System.String, UInt32, Microsoft.VisualStudio.Shell.Interop.IVsFileChangeEvents, UInt32 ByRef)\r\n12a3f2ec 1c66a5a4 TypeScriptLanguageService.ScriptContext.FileChangeNotificationService.StartListening(System.String, System.EventHandler)\r\n12a3f328 1c66a116 TypeScriptLanguageService.ScriptContext.DefaultClosedFilesProvider.GetEntry(System.String)\r\n12a3f388 1a898612 TypeScriptLanguageService.ScriptContext.DefaultClosedFilesProvider.GetEncoding(System.String)\r\n12a3f39c 1a8984af TypeScriptLanguageService.ScriptContext.Script.get_CurrentSnapshot()\r\n12a3f3dc 1a8983f8 TypeScriptLanguageService.ScriptContext.DefaultScriptContext.<GetFileNameToScriptSnapshot>b__1(TypeScriptLanguageService.ScriptContext.Script)\r\n12a3f3e0 6f33f264 System.Linq.Enumerable.ToDictionary[[System.__Canon, mscorlib],[System.__Canon, mscorlib],[System.__Canon, mscorlib]](System.Collections.Generic.IEnumerable`1<System.__Canon>, System.Func`2<System.__Canon,System.__Canon>, System.Func`2<System.__Canon,System.__Canon>, System.Collections.Generic.IEqualityComparer`1<System.__Canon>)\r\n12a3f420 1a8983b0 TypeScriptLanguageService.ScriptContext.DefaultScriptContext.GetFileNameToScriptSnapshot()\r\n12a3f430 1a8982ef TypeScriptLanguageService.ScriptContext.DefaultScriptContext.get_CurrentSnapshot()\r\n12a3f440 1c57adfd TypeScriptLanguageService.Features.Outlining.OutliningController+<>c__DisplayClass3.<EnqueueGetOutliningRegionsTask>b__0()\r\n12a3f450 1c57ad3e TypeScriptLanguageService.CompilerServices.TypeScriptLanguageServicesTask.Run()\r\n12a3f460 1c57ac59 TypeScriptLanguageService.Threading.BackgroundThreadQueue+<>c__DisplayClass8.<ExecuteOneTask>b__4()\r\n12a3f484 1c57ab88 GuardMethodClass.GuardMethod(System.Func`1<System.Object>, System.Func`2<System.Exception,Boolean>, System.Func`2<System.Exception,System.Object>)\r\n12a3f4ac 1c57a3c6 TypeScriptLanguageService.VsErrorReport.ExceptionFilter.Guard(System.Func`1<System.Object>, System.Func`2<System.Exception,Boolean>, System.Func`2<System.Exception,System.Object>)\r\n12a3f4c0 1c57a356 TypeScriptLanguageService.Threading.BackgroundThreadQueue.ExecuteOneTask(TypeScriptLanguageService.Threading.BackgroundTask)\r\n12a3f4d8 1c579aa0 TypeScriptLanguageService.Threading.BackgroundThreadQueue.ExecuteTasks()\r\n12a3f4e4 1896b8c9 TypeScriptLanguageService.Threading.BackgroundThreadQueue.Loop()\r\n12a3f4f0 714913c7 System.Threading.Tasks.Task.InnerInvoke()\r\n12a3f4fc 7149134a System.Threading.Tasks.Task.Execute()\r\n12a3f520 71491319 System.Threading.Tasks.Task.ExecutionContextCallback(System.Object)\r\n12a3f524 7145da07 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)\r\n12a3f590 7145d956 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)\r\n12a3f5a4 71491138 System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)\r\n12a3f608 71491057 System.Threading.Tasks.Task.ExecuteEntry(Boolean)\r\n12a3f618 71490fa3 System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()\r\n12a3f61c 7147e929 System.Threading.ThreadPoolWorkQueue.Dispatch()\r\n12a3f66c 7147e7d5 System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()\r\n12a3f894 721c2552 [DebuggerU2MCatchHandlerFrame: 12a3f894] \r\n```\r\n\r\n2. The main thread is waiting on:\r\n```\r\n0:000> !clrstack\r\nOS Thread Id: 0x53ec (0)\r\nChild SP       IP Call Site\r\n0034e738 775f013d [HelperMethodFrame_1OBJ: 0034e738] System.Threading.SynchronizationContext.WaitHelper(IntPtr[], Boolean, Int32)\r\n0034e9dc 77cf7a8a System.Windows.Threading.DispatcherSynchronizationContext.Wait(IntPtr[], Boolean, Int32)\r\n0034e9f0 71444a4e System.Threading.SynchronizationContext.InvokeWaitMethodHelper(System.Threading.SynchronizationContext, IntPtr[], Boolean, Int32)\r\n0034ec28 721c2552 [GCFrame: 0034ec28] \r\n0034ed48 721c2552 [GCFrame: 0034ed48] \r\n0034eeec 721c2552 [GCFrame: 0034eeec] \r\n0034ee9c 721c2552 [HelperMethodFrame: 0034ee9c] System.Threading.Monitor.ReliableEnter(System.Object, Boolean ByRef)\r\n0034ef2c 1e7fe825 TypeScriptLanguageService.ScriptContext.DefaultClosedFilesProvider.OnFileChanged(System.String)\r\n0034ef64 1e7fe7ce TypeScriptLanguageService.ScriptContext.DefaultClosedFilesProvider+<>c__DisplayClass3.<GetEntry>b__1(System.Object, System.EventArgs)\r\n0034ef6c 1e7fe7a7 TypeScriptLanguageService.ScriptContext.FileChangeNotificationService+Listener.Microsoft.VisualStudio.Shell.Interop.IVsFileChangeEvents.FilesChanged(UInt32, System.String[], UInt32[])\r\n0034ef78 1e7fe772 Microsoft.VisualStudio.Services.FileChangeSubscription+<>c__DisplayClass2.<Notify>b__0()\r\n0034ef8c 77900044 Microsoft.VisualStudio.ErrorHandler.CallWithCOMConvention(System.Func`1<Int32>, Boolean, Boolean)\r\n0034efc0 1e7fe3d5 Microsoft.VisualStudio.Services.FileChangeSubscription.Notify(Microsoft.VisualStudio.Shell.Interop._VSFILECHANGEFLAGS)\r\n0034efd8 506bd4cc Microsoft.VisualStudio.Services.FileChangeSubscription.Notify(System.IO.WatcherChangeTypes, Microsoft.VisualStudio.Services.FileProperties)\r\n0034f000 504ca93d Microsoft.VisualStudio.Services.FileWatcher.Notify(Microsoft.VisualStudio.Services.ChangeStreamDigest)\r\n0034f064 504c6a06 Microsoft.VisualStudio.Services.DirectoryWatcher.ProcessFileChanges(System.Collections.Generic.IEnumerable`1<System.Collections.Generic.KeyValuePair`2<System.String,Microsoft.VisualStudio.Services.ChangeStreamDigest>>, Int32)\r\n0034f0a8 504c6671 Microsoft.VisualStudio.Services.DirectoryWatcher.ProcessChanges(System.Collections.Generic.IEnumerable`1<System.Collections.Generic.KeyValuePair`2<System.String,Microsoft.VisualStudio.Services.ChangeStreamDigest>>, Int32)\r\n0034f0e8 504c67d2 Microsoft.VisualStudio.Services.DirectoryWatcher.ProcessChanges(System.Collections.Generic.IEnumerable`1<System.Collections.Generic.KeyValuePair`2<System.String,Microsoft.VisualStudio.Services.ChangeStreamDigest>>, Int32)\r\n0034f128 504c65b2 Microsoft.VisualStudio.Services.DirectoryWatcher.OnChangedAsync()\r\n0034f164 77cf8689 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)\r\n0034f184 77cf855a MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)\r\n0034f1c8 77cfac3c System.Windows.Threading.DispatcherOperation.InvokeImpl()\r\n0034f200 77cfab88 System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)\r\n0034f208 7145da07 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)\r\n0034f274 7145d956 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)\r\n0034f288 7145d921 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)\r\n0034f2a0 77cfaaab System.Windows.Threading.DispatcherOperation.Invoke()\r\n0034f2d8 77cf742b System.Windows.Threading.Dispatcher.ProcessQueue()\r\n0034f320 77cf75ca System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)\r\n0034f36c 77cf880b MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)\r\n0034f3a8 77cf875b MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)\r\n0034f3b8 77cf8622 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)\r\n0034f3d8 77cf855a MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)\r\n0034f41c 77cf6cfe System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)\r\n0034f470 77cf80e1 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)\r\n```\r\n\r\n3. The observed sequence looks like:\r\na. The build starts and after building Core (or in moment of building), the UI freeze\r\nb. Then red squiggles appears on lines with file references to Core.d.ts\r\nc. Then either it will succeed and unfreeze OR\r\nd. It hangs - ~0 CPU usage, etc\r\n\r\n4. If TS file is not opened in VS editor during the build, if I remember I haven't observed hang. I'm almost sure that without opened TS file, it just work!\r\n\r\n### Other info\r\nNo Resharper, Web Essentials disabled"}}