System.NullReferenceException in AzureStorageOrchestrationService.CompleteTaskOrchestrationWorkItemAsync
- Dominant language
- C#
- Stars
- 1.7k
- Forks
- 335
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 6
Description
Version: Core 2.4.1, AzureStorate: 1.8.1
For our use case we use sub orchestrations and external events, however we observed random NPE and our main orchestration instance get stuck since the sub orchestration instance never gets created.
Exception:
```
DurableTask.Core[29]
TaskOrchestrationDispatcher-1bc6efed64814fb897c9e58d6f22c01b-0: Unhandled exception with work item 'fb874f1e8645614ea67e2330b4c60fcd': System.NullReferenceException: Object reference not set to an instance of an object.
at DurableTask.AzureStorage.AzureStorageOrchestrationService.CompleteTaskOrchestrationWorkItemAsync(TaskOrchestrationWorkItem workItem, OrchestrationRuntimeState newOrchestrationRuntimeState, IList`1 outboundMessages, IList`1 orchestratorMessages, IList`1 timerMessages, TaskMessage continuedAsNewMessage, OrchestrationState orchestrationState) in C:\source\durabletask\src\DurableTask.AzureStorage\AzureStorageOrchestrationService.cs:line 1005
at DurableTask.Core.TaskOrchestrationDispatcher.OnProcessWorkItemAsync(TaskOrchestrationWorkItem workItem) in C:\source\durabletask\src\DurableTask.Core\TaskOrchestrationDispatcher.cs:line 463
at DurableTask.Core.TaskOrchestrationDispatcher.OnProcessWorkItemSessionAsync(TaskOrchestrationWorkItem workItem) in C:\source\durabletask\src\DurableTask.Core\TaskOrchestrationDispatcher.cs:line 194
at DurableTask.Core.WorkItemDispatcher`1.ProcessWorkItemAsync(WorkItemDispatcherContext context, Object workItemObj) in C:\source\durabletask\src\DurableTask.Core\WorkItemDispatcher.cs:line 459
Backing off for 10 seconds until 5 successful operations
```
While debugging locally we found this line gets `runtimeState.OrchestrationInstance` as null.
https://github.com/Azure/durabletask/blob/bcc97e874baba09c722a83c164bb3ab2245017ec/src/DurableTask.AzureStorage/AzureStorageOrchestrationService.cs#L948
below logic in the same method assumes the `runtimeState.OrchestrationInstance` can be null but not that line.
example line that expects nullable instance
https://github.com/Azure/durabletask/blob/bcc97e874baba09c722a83c164bb3ab2245017ec/src/DurableTask.AzureStorage/AzureStorageOrchestrationService.cs#L972
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.