Skip to content

Commit a2d54e6

Browse files
committed
Rename RestartExecutionsWithoutMessages to RestartExecutions
1 parent 961b95a commit a2d54e6

19 files changed

Lines changed: 82 additions & 82 deletions

File tree

Core/Cleipnir.ResilientFunctions.Tests/InMemoryTests/StoreCrudTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,25 @@ public override Task ParameterAndStateAreNotUpdatedWhenEpochDoesNotMatch()
5858

5959

6060
[TestMethod]
61-
public override Task RestartExecutionsWithoutMessagesReturnsEmptyDictionaryWhenNoFlowsAreEligible()
62-
=> RestartExecutionsWithoutMessagesReturnsEmptyDictionaryWhenNoFlowsAreEligible(FunctionStoreFactory.Create());
61+
public override Task RestartExecutionsReturnsEmptyDictionaryWhenNoFlowsAreEligible()
62+
=> RestartExecutionsReturnsEmptyDictionaryWhenNoFlowsAreEligible(FunctionStoreFactory.Create());
6363

6464

6565

6666

6767
[TestMethod]
68-
public override Task RestartExecutionsWithoutMessagesRestartsMultipleUnownedFlows()
69-
=> RestartExecutionsWithoutMessagesRestartsMultipleUnownedFlows(FunctionStoreFactory.Create());
68+
public override Task RestartExecutionsRestartsMultipleUnownedFlows()
69+
=> RestartExecutionsRestartsMultipleUnownedFlows(FunctionStoreFactory.Create());
7070

7171
[TestMethod]
72-
public override Task RestartExecutionsWithoutMessagesRestartsOnlyUnownedFlows()
73-
=> RestartExecutionsWithoutMessagesRestartsOnlyUnownedFlows(FunctionStoreFactory.Create());
72+
public override Task RestartExecutionsRestartsOnlyUnownedFlows()
73+
=> RestartExecutionsRestartsOnlyUnownedFlows(FunctionStoreFactory.Create());
7474

7575
[TestMethod]
76-
public override Task RestartExecutionsWithoutMessagesReturnsEmptyDictionaryForEmptyInput()
77-
=> RestartExecutionsWithoutMessagesReturnsEmptyDictionaryForEmptyInput(FunctionStoreFactory.Create());
76+
public override Task RestartExecutionsReturnsEmptyDictionaryForEmptyInput()
77+
=> RestartExecutionsReturnsEmptyDictionaryForEmptyInput(FunctionStoreFactory.Create());
7878

7979
[TestMethod]
80-
public override Task RestartExecutionsWithoutMessagesIncludesExistingEffects()
81-
=> RestartExecutionsWithoutMessagesIncludesExistingEffects(FunctionStoreFactory.Create());
80+
public override Task RestartExecutionsIncludesExistingEffects()
81+
=> RestartExecutionsIncludesExistingEffects(FunctionStoreFactory.Create());
8282
}

Core/Cleipnir.ResilientFunctions.Tests/InMemoryTests/StoreTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ public override Task GetResultsReturnsOnlyExistingFunctionResults()
212212

213213

214214
[TestMethod]
215-
public override Task RestartExecutionsWithoutMessagesDoesNotReturnFlowClaimedByPreviousCall()
216-
=> RestartExecutionsWithoutMessagesDoesNotReturnFlowClaimedByPreviousCall(FunctionStoreFactory.Create());
215+
public override Task RestartExecutionsDoesNotReturnFlowClaimedByPreviousCall()
216+
=> RestartExecutionsDoesNotReturnFlowClaimedByPreviousCall(FunctionStoreFactory.Create());
217217

218218
[TestMethod]
219219
public override Task RestartExecutionsDoesNotClaimSucceededFlow()

Core/Cleipnir.ResilientFunctions.Tests/TestTemplates/StoreCrudTests.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ await store.SetParameters(
312312
sf.Parameter.ShouldNotBeNull();
313313
}
314314

315-
public abstract Task RestartExecutionsWithoutMessagesReturnsEmptyDictionaryWhenNoFlowsAreEligible();
316-
public async Task RestartExecutionsWithoutMessagesReturnsEmptyDictionaryWhenNoFlowsAreEligible(Task<IFunctionStore> storeTask)
315+
public abstract Task RestartExecutionsReturnsEmptyDictionaryWhenNoFlowsAreEligible();
316+
public async Task RestartExecutionsReturnsEmptyDictionaryWhenNoFlowsAreEligible(Task<IFunctionStore> storeTask)
317317
{
318318
var store = await storeTask;
319319
var storedId1 = TestStoredId.Create();
@@ -342,13 +342,13 @@ await store.CreateFunction(
342342
);
343343

344344
// Try to restart - should return empty dictionary
345-
var result = await store.RestartExecutionsWithoutMessages([storedId1, storedId2], newOwner);
345+
var result = await store.RestartExecutions([storedId1, storedId2], newOwner);
346346

347347
result.Count.ShouldBe(0);
348348
}
349349

350-
public abstract Task RestartExecutionsWithoutMessagesRestartsMultipleUnownedFlows();
351-
public async Task RestartExecutionsWithoutMessagesRestartsMultipleUnownedFlows(Task<IFunctionStore> storeTask)
350+
public abstract Task RestartExecutionsRestartsMultipleUnownedFlows();
351+
public async Task RestartExecutionsRestartsMultipleUnownedFlows(Task<IFunctionStore> storeTask)
352352
{
353353
var store = await storeTask;
354354
var storedId1 = TestStoredId.Create();
@@ -386,7 +386,7 @@ await store.CreateFunction(
386386
);
387387

388388
// Restart all three
389-
var result = await store.RestartExecutionsWithoutMessages([storedId1, storedId2, storedId3], owner);
389+
var result = await store.RestartExecutions([storedId1, storedId2, storedId3], owner);
390390

391391
// All three should be restarted
392392
result.Count.ShouldBe(3);
@@ -402,8 +402,8 @@ await store.CreateFunction(
402402
result[storedId3].StoredFlow.Status.ShouldBe(Status.Executing);
403403
}
404404

405-
public abstract Task RestartExecutionsWithoutMessagesRestartsOnlyUnownedFlows();
406-
public async Task RestartExecutionsWithoutMessagesRestartsOnlyUnownedFlows(Task<IFunctionStore> storeTask)
405+
public abstract Task RestartExecutionsRestartsOnlyUnownedFlows();
406+
public async Task RestartExecutionsRestartsOnlyUnownedFlows(Task<IFunctionStore> storeTask)
407407
{
408408
var store = await storeTask;
409409
var storedId1 = TestStoredId.Create();
@@ -442,7 +442,7 @@ await store.CreateFunction(
442442
);
443443

444444
// Restart all three - only 1 and 3 should succeed
445-
var result = await store.RestartExecutionsWithoutMessages([storedId1, storedId2, storedId3], newOwner);
445+
var result = await store.RestartExecutions([storedId1, storedId2, storedId3], newOwner);
446446

447447
result.Count.ShouldBe(2);
448448
result.ContainsKey(storedId1).ShouldBeTrue();
@@ -453,19 +453,19 @@ await store.CreateFunction(
453453
result[storedId3].StoredFlow.OwnerId.ShouldBe(newOwner);
454454
}
455455

456-
public abstract Task RestartExecutionsWithoutMessagesReturnsEmptyDictionaryForEmptyInput();
457-
public async Task RestartExecutionsWithoutMessagesReturnsEmptyDictionaryForEmptyInput(Task<IFunctionStore> storeTask)
456+
public abstract Task RestartExecutionsReturnsEmptyDictionaryForEmptyInput();
457+
public async Task RestartExecutionsReturnsEmptyDictionaryForEmptyInput(Task<IFunctionStore> storeTask)
458458
{
459459
var store = await storeTask;
460460
var owner = ReplicaId.NewId();
461461

462-
var result = await store.RestartExecutionsWithoutMessages([], owner);
462+
var result = await store.RestartExecutions([], owner);
463463

464464
result.Count.ShouldBe(0);
465465
}
466466

467-
public abstract Task RestartExecutionsWithoutMessagesIncludesExistingEffects();
468-
public async Task RestartExecutionsWithoutMessagesIncludesExistingEffects(Task<IFunctionStore> storeTask)
467+
public abstract Task RestartExecutionsIncludesExistingEffects();
468+
public async Task RestartExecutionsIncludesExistingEffects(Task<IFunctionStore> storeTask)
469469
{
470470
var store = await storeTask;
471471
var storedId1 = TestStoredId.Create();
@@ -488,7 +488,7 @@ public async Task RestartExecutionsWithoutMessagesIncludesExistingEffects(Task<I
488488
Alias: null
489489
);
490490

491-
// Create messages - these must NOT be fetched by RestartExecutionsWithoutMessages
491+
// Create messages - these must NOT be fetched by RestartExecutions
492492
var message1 = new StoredMessage(
493493
MessageContent: "message1".ToUtf8Bytes(),
494494
MessageType: "Type1".ToUtf8Bytes(),
@@ -529,7 +529,7 @@ await store.CreateFunction(
529529
);
530530

531531
// Restart both
532-
var result = await store.RestartExecutionsWithoutMessages([storedId1, storedId2], owner);
532+
var result = await store.RestartExecutions([storedId1, storedId2], owner);
533533

534534
// Verify both flows returned with their effects
535535
result.Count.ShouldBe(2);

Core/Cleipnir.ResilientFunctions.Tests/TestTemplates/StoreTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,8 +1763,8 @@ await store.SucceedFunction(
17631763
results.ContainsKey(nonExistentFunctionId).ShouldBeFalse();
17641764
}
17651765

1766-
public abstract Task RestartExecutionsWithoutMessagesDoesNotReturnFlowClaimedByPreviousCall();
1767-
protected async Task RestartExecutionsWithoutMessagesDoesNotReturnFlowClaimedByPreviousCall(Task<IFunctionStore> storeTask)
1766+
public abstract Task RestartExecutionsDoesNotReturnFlowClaimedByPreviousCall();
1767+
protected async Task RestartExecutionsDoesNotReturnFlowClaimedByPreviousCall(Task<IFunctionStore> storeTask)
17681768
{
17691769
var store = await storeTask;
17701770
var functionId = TestStoredId.Create();
@@ -1780,13 +1780,13 @@ await store.CreateFunction(
17801780
owner: null
17811781
);
17821782

1783-
var firstClaim = await store.RestartExecutionsWithoutMessages([functionId], replicaId);
1783+
var firstClaim = await store.RestartExecutions([functionId], replicaId);
17841784
firstClaim.Count.ShouldBe(1);
17851785
firstClaim.ContainsKey(functionId).ShouldBeTrue();
17861786
firstClaim[functionId].StoredFlow.OwnerId.ShouldBe(replicaId);
17871787
firstClaim[functionId].StoredFlow.Status.ShouldBe(Status.Executing);
17881788

1789-
var secondClaim = await store.RestartExecutionsWithoutMessages([functionId], replicaId);
1789+
var secondClaim = await store.RestartExecutions([functionId], replicaId);
17901790
secondClaim.ShouldBeEmpty();
17911791
}
17921792

@@ -1818,7 +1818,7 @@ await store.SucceedFunction(
18181818
).ShouldBeTrueAsync();
18191819

18201820
// A message arriving after the flow completed must not resurrect it.
1821-
var claimedWithoutMessages = await store.RestartExecutionsWithoutMessages([functionId], ReplicaId.NewId());
1821+
var claimedWithoutMessages = await store.RestartExecutions([functionId], ReplicaId.NewId());
18221822
claimedWithoutMessages.ShouldBeEmpty();
18231823

18241824
var sf = await store.GetFunction(functionId);
@@ -1853,7 +1853,7 @@ await store.SuspendFunction(
18531853
).ShouldBeTrueAsync();
18541854

18551855
var newOwner = ReplicaId.NewId();
1856-
var claimed = await store.RestartExecutionsWithoutMessages([functionId], newOwner);
1856+
var claimed = await store.RestartExecutions([functionId], newOwner);
18571857
claimed.Count.ShouldBe(1);
18581858
claimed[functionId].StoredFlow.OwnerId.ShouldBe(newOwner);
18591859
claimed[functionId].StoredFlow.Status.ShouldBe(Status.Executing);

Core/Cleipnir.ResilientFunctions.Tests/TestTemplates/WatchDogsTests/CrashableFunctionStore.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ public Task<int> BulkScheduleFunctions(IEnumerable<IdWithParam> functionsWithPar
7676
? Task.FromException<StoredFlowWithEffects?>(new TimeoutException())
7777
: _inner.RestartExecution(storedId, replicaId);
7878

79-
public Task<Dictionary<StoredId, StoredFlowWithEffects>> RestartExecutionsWithoutMessages(IReadOnlyList<StoredId> storedIds, ReplicaId owner)
79+
public Task<Dictionary<StoredId, StoredFlowWithEffects>> RestartExecutions(IReadOnlyList<StoredId> storedIds, ReplicaId owner)
8080
=> _crashed
8181
? Task.FromException<Dictionary<StoredId, StoredFlowWithEffects>>(new TimeoutException())
82-
: _inner.RestartExecutionsWithoutMessages(storedIds, owner);
82+
: _inner.RestartExecutions(storedIds, owner);
8383

8484
public Task<IReadOnlyList<StoredId>> GetExpiredFunctions(long isEligibleBefore)
8585
=> _crashed

Core/Cleipnir.ResilientFunctions/CoreRuntime/FlowsManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public async Task RestartExecutions(IEnumerable<StoredMessages> messages)
106106
try
107107
{
108108
results = await _functionStore
109-
.RestartExecutionsWithoutMessages(groups.Keys.ToList(), _clusterInfo.ReplicaId);
109+
.RestartExecutions(groups.Keys.ToList(), _clusterInfo.ReplicaId);
110110
}
111111
catch
112112
{
@@ -148,7 +148,7 @@ public async Task RestartExecutions(IEnumerable<StoredMessages> messages)
148148

149149
// Resume each restarted flow, supplying the messages we already hold so it does not re-fetch them. Empty
150150
// messages exist only to force the restart, so they are excluded from delivery. The claim + flow snapshot
151-
// returned by RestartExecutionsWithoutMessages is everything the delegate needs, so no further store
151+
// returned by RestartExecutions is everything the delegate needs, so no further store
152152
// round-trip or re-claim is performed.
153153
foreach (var (storedId, storedFlowWithEffects) in results)
154154
{

Core/Cleipnir.ResilientFunctions/CoreRuntime/Watchdogs/PostponedWatchdog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private async Task Start()
7979
.ToList();
8080

8181
var restarts = await _functionStore
82-
.RestartExecutionsWithoutMessages(ownedFunctions, _clusterInfo.ReplicaId);
82+
.RestartExecutions(ownedFunctions, _clusterInfo.ReplicaId);
8383

8484
foreach (var id in restarts.Keys)
8585
{

Core/Cleipnir.ResilientFunctions/Storage/IFunctionStore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Task<int> BulkScheduleFunctions(
3232
);
3333

3434
Task<StoredFlowWithEffects?> RestartExecution(StoredId storedId, ReplicaId owner);
35-
Task<Dictionary<StoredId, StoredFlowWithEffects>> RestartExecutionsWithoutMessages(IReadOnlyList<StoredId> storedIds, ReplicaId owner);
35+
Task<Dictionary<StoredId, StoredFlowWithEffects>> RestartExecutions(IReadOnlyList<StoredId> storedIds, ReplicaId owner);
3636

3737
Task<IReadOnlyList<StoredId>> GetExpiredFunctions(long expiresBefore);
3838
Task<IReadOnlyList<StoredId>> GetSucceededFunctions(long completedBefore);

Core/Cleipnir.ResilientFunctions/Storage/InMemoryFunctionStore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public Task<int> BulkScheduleFunctions(IEnumerable<IdWithParam> functionsWithPar
145145
);
146146
}
147147

148-
public virtual async Task<Dictionary<StoredId, StoredFlowWithEffects>> RestartExecutionsWithoutMessages(
148+
public virtual async Task<Dictionary<StoredId, StoredFlowWithEffects>> RestartExecutions(
149149
IReadOnlyList<StoredId> storedIds,
150150
ReplicaId owner)
151151
{

Samples/Sample.ConsoleApp/Utils/CrashableFunctionStore.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ public Task<int> BulkScheduleFunctions(IEnumerable<IdWithParam> functionsWithPar
5858
? Task.FromException<StoredFlowWithEffects?>(new TimeoutException())
5959
: _inner.RestartExecution(storedId, replicaId);
6060

61-
public Task<Dictionary<StoredId, StoredFlowWithEffects>> RestartExecutionsWithoutMessages(IReadOnlyList<StoredId> storedIds, ReplicaId owner)
61+
public Task<Dictionary<StoredId, StoredFlowWithEffects>> RestartExecutions(IReadOnlyList<StoredId> storedIds, ReplicaId owner)
6262
=> _crashed
6363
? Task.FromException<Dictionary<StoredId, StoredFlowWithEffects>>(new TimeoutException())
64-
: _inner.RestartExecutionsWithoutMessages(storedIds, owner);
64+
: _inner.RestartExecutions(storedIds, owner);
6565

6666
public Task<IReadOnlyList<StoredId>> GetExpiredFunctions(long expiresBefore)
6767
=> _crashed

0 commit comments

Comments
 (0)