Skip to content

Commit a2248d2

Browse files
committed
Do not await empty-message delete in restart hand-over
1 parent 9af42a4 commit a2248d2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Core/Cleipnir.ResilientFunctions/CoreRuntime/Invocation/InvocationHelper.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,13 @@ public async Task PublishCompletionMessageToParent(StoredId? parent, FlowId chil
226226

227227
// The message snapshot comes straight from the store and can contain empty messages - restart-pokes with
228228
// nothing to deliver. The restart they were appended to force is happening right now, so delete them and
229-
// hand over only the deliverable messages.
229+
// hand over only the deliverable messages. The delete is deliberately not awaited so it does not delay
230+
// the restart: the clearer retries internally until it lands, and a poke re-fetched before then only
231+
// causes a harmless extra restart.
230232
var messages = restarted.Messages;
231233
if (messages.Any(m => m.IsEmpty))
232234
{
233-
await _messageClearer.Clear(messages.Where(m => m.IsEmpty).Select(m => m.Position).ToList());
235+
_ = _messageClearer.Clear(messages.Where(m => m.IsEmpty).Select(m => m.Position).ToList());
234236
messages = messages.Where(m => !m.IsEmpty).ToList();
235237
}
236238

0 commit comments

Comments
 (0)