Azure / Azure/azure-functions-host

ScriptHost.Initialize blocked forever

Open
#2,640 3 comments 0 reactions 1 assignee Claimed by @fabiocav View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 10h
Merged PRs (30d)
36

Description

Below is a sample of such issues. It is likely a Azure File issue that blocked forever. The outcome is the worker was hosed and timeout all its requests. It wasn't removed nor restarted.

```csharp
OS Thread Id: 0x18bc (33)
Child SP IP Call Site
00000064677fe308 00007ffbe82181b4 [InlinedCallFrame: 00000064677fe308] Microsoft.Win32.UnsafeNativeMethods.ReadDirectoryChangesW(Microsoft.Win32.SafeHandles.SafeFileHandle, System.Runtime.InteropServices.HandleRef, Int32, Int32, Int32, Int32 ByRef, System.Threading.NativeOverlapped*, System.Runtime.InteropServices.HandleRef)
00000064677fe308 00007ffbd6064dab [InlinedCallFrame: 00000064677fe308] Microsoft.Win32.UnsafeNativeMethods.ReadDirectoryChangesW(Microsoft.Win32.SafeHandles.SafeFileHandle, System.Runtime.InteropServices.HandleRef, Int32, Int32, Int32, Int32 ByRef, System.Threading.NativeOverlapped*, System.Runtime.InteropServices.HandleRef)
00000064677fe2b0 00007ffbd6064dab DomainNeutralILStubClass.IL_STUB_PInvoke(Microsoft.Win32.SafeHandles.SafeFileHandle, System.Runtime.InteropServices.HandleRef, Int32, Int32, Int32, Int32 ByRef, System.Threading.NativeOverlapped*, System.Runtime.InteropServices.HandleRef)
00000064677fe3b0 00007ffbd602dd38 System.IO.FileSystemWatcher.Monitor(Byte[])
00000064677fe480 00007ffbd602d9d6 System.IO.FileSystemWatcher.StartRaisingEvents()
00000064677fe4f0 00007ffb7ae10cd4 Microsoft.Azure.WebJobs.Script.IO.AutoRecoveringFileSystemWatcher.InitializeWatcher()
00000064677fe560 00007ffb7b0a3e83 Microsoft.Azure.WebJobs.Script.ScriptHost.Initialize()
00000064677fe6c0 00007ffb7b0a108c Microsoft.Azure.WebJobs.Script.ScriptHostManager.RunAndBlock(System.Threading.CancellationToken)
00000064677fe760 00007ffb7b0a0929 Microsoft.Azure.WebJobs.Script.WebHost.WebScriptHostManager.b__33_0(System.Threading.CancellationToken)
00000064677fe790 00007ffbd0d45b50 System.Web.Hosting.HostingEnvironment+<>c__DisplayClass94_0.b__0(System.Threading.CancellationToken)
00000064677fe7c0 00007ffbd0d44cbb System.Web.Hosting.BackgroundWorkScheduler+d__7.MoveNext()
00000064677fe840 00007ffbd0d0a5d2 System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[[System.Web.Hosting.BackgroundWorkScheduler+d__7, System.Web]](d__7 ByRef)
00000064677fe8f0 00007ffbd0d0a060 System.Web.Hosting.BackgroundWorkScheduler.RunWorkItemImpl(System.Func`2)
00000064677fe9a0 00007ffbd0d0a2fb System.Web.Hosting.BackgroundWorkScheduler.b__8_0(System.Object)
00000064677fe9f0 00007ffbd8baf0fd System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
00000064677fea30 00007ffbd8baf74e System.Threading.ThreadPoolWorkQueue.Dispatch()
00000064677feec8 00007ffbd9f45a03 [DebuggerU2MCatchHandlerFrame: 00000064677feec8]
00000064677ff058 00007ffbd9f45a03 [ContextTransitionFrame: 00000064677ff058]
00000064677ff288 00007ffbd9f45a03 [DebuggerU2MCatchHandlerFrame: 00000064677ff288]
OS Thread Id: 0x1830 (34)
```

Internal:
```
https://wawscus.kusto.windows.net:443/wawsprod
let duration = 1h;
let begin = datetime(2018-04-05 22:00) - 30m;
let end = begin + duration;
let stampName = "WAWSPRODDM1077";
FunctionsLogs
| where SourceMoniker == stampName
| where PreciseTimeStamp > begin and PreciseTimeStamp <= end
| where Tenant == "566faeaf0048489a9b28abc49cc976df"
| where RoleInstance == "SmallDedicatedWebWorkerRole_IN_9"
| where Source != "HttpRequestTraceHandler"
| where AppName !contains "placeholder"
| order by PreciseTimeStamp desc
| project PreciseTimeStamp, Tenant, AppName, RoleInstance , Pid , Details , Summary

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.