fix race condition on OrchestrationRuntimeState.NewEvents (#380)
* fix race condition on mutable list of new events inside OrchestrationRuntimeState. * Apply suggestions from code review Co-authored-by: David Justo <david.justo.1996@gmail.com> --------- Co-authored-by: David Justo <david.justo.1996@gmail.com>
This commit is contained in:
Родитель
b885bd4a8c
Коммит
2f94e765d5
|
@ -876,7 +876,7 @@ namespace DurableTask.Netherite
|
|||
InstanceId = workItem.InstanceId,
|
||||
BatchStartPosition = messageBatch.BatchStartPosition,
|
||||
BatchLength = messageBatch.BatchLength,
|
||||
NewEvents = (List<HistoryEvent>)newOrchestrationRuntimeState.NewEvents,
|
||||
NewEvents = newOrchestrationRuntimeState.NewEvents.ToList(), // `NewEvents` in `newOrchestrationRuntimeState` may be mutated, so we copy to avoid a surprise change.
|
||||
WorkItemForReuse = cacheWorkItemForReuse ? orchestrationWorkItem : null,
|
||||
PackPartitionTaskMessages = partition.Settings.PackPartitionTaskMessages,
|
||||
PersistFirst = partition.Settings.PersistStepsFirst ? BatchProcessed.PersistFirstStatus.Required : BatchProcessed.PersistFirstStatus.NotRequired,
|
||||
|
|
Загрузка…
Ссылка в новой задаче