fix handling of expired groups in ReassemblyState

This commit is contained in:
sebastianburckhardt 2023-04-21 09:51:50 -07:00
Родитель 08f823c711
Коммит e87a3bdd2d
1 изменённых файлов: 13 добавлений и 3 удалений

Просмотреть файл

@ -64,7 +64,13 @@ namespace DurableTask.Netherite
if (evt.IsLast) if (evt.IsLast)
{ {
evt.ReassembledEvent = FragmentationAndReassembly.Reassemble<PartitionEvent>(this.Fragments[group], evt, effects.Partition); if (!this.Fragments.TryGetValue(group, out var list))
{
effects.EventTraceHelper.TraceEventProcessingDetail($"Discarded fragment ${evt.Fragment} for expired group {group}");
return;
}
evt.ReassembledEvent = FragmentationAndReassembly.Reassemble<PartitionEvent>(list, evt, effects.Partition);
effects.EventDetailTracer?.TraceEventProcessingDetail($"Reassembled {evt.ReassembledEvent}"); effects.EventDetailTracer?.TraceEventProcessingDetail($"Reassembled {evt.ReassembledEvent}");
@ -102,7 +108,11 @@ namespace DurableTask.Netherite
} }
else else
{ {
list = this.Fragments[group]; if (!this.Fragments.TryGetValue(group, out list))
{
effects.EventTraceHelper.TraceEventProcessingDetail($"Discarded fragment ${evt.Fragment} for expired group {group}");
return;
}
} }
list.Add(evt); list.Add(evt);