Azure / Azure/durabletask

System.NullReferenceException in AzureStorageOrchestrationService.CompleteTaskOrchestrationWorkItemAsync

Aperta
#487 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C#
Stelle
1.7k
Fork
335
Merge medio
2g 23h
PR unite (30g)
6

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia in src/DurableTask.AzureStorage/AzureStorageOrchestrationService.cs, in particolare nella logica intorno alle righe 948, 972 e 1005, e traccia come viene valorizzato runtimeState.OrchestrationInstance per le sub-orchestrazioni e gli eventi esterni. Riproduci la NullReferenceException segnalata con questo workflow e verifica che il completamento non fallisca più né lasci bloccata l'orchestrazione principale quando l'istanza è null.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
azure, csharp
Ambito
cloud, distributed-systems
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.