Skip to content

Commit

Permalink
Merge branch 'dev' into fix-persistence-recovery-timer-leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkatufus authored Oct 1, 2024
2 parents d7cff60 + f5c4e63 commit 6deb2a2
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 12 deletions.
20 changes: 20 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
#### 1.5.29 October 1st 2024 ####

Akka.NET v1.5.29 is an emergency patch release that addresses a severe bug for persistence users whom also use protobuf serializer.

* [DData: Remove Hyperion dependency](https://github.com/akkadotnet/akka.net/pull/7337)
* [Streams: Fix SelectAsync race condition bug](https://github.com/akkadotnet/akka.net/pull/7338)
* [Core: Add new IWithTimers API to allow sender override](https://github.com/akkadotnet/akka.net/pull/7341)
* [Persistence: Fix SnapshotMetadata default timestamp value (DateTimeKind.Utc bug)](https://github.com/akkadotnet/akka.net/pull/7349)
* [Core: Fix AskTimeoutException message formatting bug](https://github.com/akkadotnet/akka.net/pull/7350)

To [see the full set of changes in Akka.NET v1.5.29, click here](https://github.com/akkadotnet/akka.net/milestone/112?closed=1).

3 contributors since release 1.5.28

| COMMITS | LOC+ | LOC- | AUTHOR |
|---------|------|------|---------------------|
| 4 | 177 | 14 | Gregorius Soedharmo |
| 1 | 10 | 10 | Simon Cropp |
| 1 | 0 | 1 | Aaron Stannard |

#### 1.5.28 September 5th 2024 ####

Akka.NET v1.5.28 is a release with several bug fixes and improvements.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected override void AfterAll()
public void LocalSnapshotStore_can_snapshot_actors_with_PersistenceId_containing_invalid_path_characters()
{
var pid = @"p\/:*?-1";
SnapshotStore.Tell(new SaveSnapshot(new SnapshotMetadata(pid, 1, Sys.Scheduler.Now.DateTime), "sample data"), TestActor);
SnapshotStore.Tell(new SaveSnapshot(new SnapshotMetadata(pid, 1, Sys.Scheduler.DateTimeNow), "sample data"), TestActor);
ExpectMsg<SaveSnapshotSuccess>();

SnapshotStore.Tell(new LoadSnapshot(pid, SnapshotSelectionCriteria.Latest, long.MaxValue), TestActor);
Expand Down
3 changes: 2 additions & 1 deletion src/core/Akka.Persistence.TCK/Query/PersistenceIdsSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ protected IActorRef WriteSnapshot(string persistenceId, int n)
ExpectMsg($"{persistenceId}-{i}-done");
}

var metadata = new SnapshotMetadata(persistenceId, n + 10, Sys.Scheduler.Now.DateTime);
var metadata = new SnapshotMetadata(persistenceId, n + 10, Sys.Scheduler.DateTimeNow);
metadata.Timestamp.Kind.Should().Be(DateTimeKind.Utc);
SnapshotStore.Tell(new SaveSnapshot(metadata, $"s-{n}"), _senderProbe.Ref);
_senderProbe.ExpectMsg<SaveSnapshotSuccess>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public virtual void SnapshotStore_should_serialize_Payload()

var snapshot = new Test.MySnapshot("a");

var metadata = new SnapshotMetadata(Pid, 1, Sys.Scheduler.Now.DateTime);
var metadata = new SnapshotMetadata(Pid, 1, Sys.Scheduler.DateTimeNow);
metadata.Timestamp.Kind.Should().Be(DateTimeKind.Utc);
SnapshotStore.Tell(new SaveSnapshot(metadata, snapshot), probe.Ref);
probe.ExpectMsg<SaveSnapshotSuccess>();

Expand All @@ -85,7 +86,8 @@ public virtual void SnapshotStore_should_serialize_Payload_with_string_manifest(

var snapshot = new Test.MySnapshot2("a");

var metadata = new SnapshotMetadata(Pid, 1, Sys.Scheduler.Now.DateTime);
var metadata = new SnapshotMetadata(Pid, 1, Sys.Scheduler.DateTimeNow);
metadata.Timestamp.Kind.Should().Be(DateTimeKind.Utc);
SnapshotStore.Tell(new SaveSnapshot(metadata, snapshot), probe.Ref);
probe.ExpectMsg<SaveSnapshotSuccess>();

Expand All @@ -107,7 +109,8 @@ public virtual void SnapshotStore_should_serialize_AtLeastOnceDeliverySnapshot()
};
var atLeastOnceDeliverySnapshot = new AtLeastOnceDeliverySnapshot(17, unconfirmed);

var metadata = new SnapshotMetadata(Pid, 2, Sys.Scheduler.Now.DateTime);
var metadata = new SnapshotMetadata(Pid, 2, Sys.Scheduler.DateTimeNow);
metadata.Timestamp.Kind.Should().Be(DateTimeKind.Utc);
SnapshotStore.Tell(new SaveSnapshot(metadata, atLeastOnceDeliverySnapshot), probe.Ref);
probe.ExpectMsg<SaveSnapshotSuccess>();

Expand All @@ -123,7 +126,8 @@ public virtual void SnapshotStore_should_serialize_AtLeastOnceDeliverySnapshot_w
var unconfirmed = Array.Empty<UnconfirmedDelivery>();
var atLeastOnceDeliverySnapshot = new AtLeastOnceDeliverySnapshot(13, unconfirmed);

var metadata = new SnapshotMetadata(Pid, 2, Sys.Scheduler.Now.DateTime);
var metadata = new SnapshotMetadata(Pid, 2, Sys.Scheduler.DateTimeNow);
metadata.Timestamp.Kind.Should().Be(DateTimeKind.Utc);
SnapshotStore.Tell(new SaveSnapshot(metadata, atLeastOnceDeliverySnapshot), probe.Ref);
probe.ExpectMsg<SaveSnapshotSuccess>();

Expand All @@ -138,7 +142,8 @@ public virtual void SnapshotStore_should_serialize_PersistentFSMSnapshot()

var persistentFSMSnapshot = new PersistentFSM.PersistentFSMSnapshot<string>("mystate", "mydata", TimeSpan.FromDays(4));

var metadata = new SnapshotMetadata(Pid, 2, Sys.Scheduler.Now.DateTime);
var metadata = new SnapshotMetadata(Pid, 2, Sys.Scheduler.DateTimeNow);
metadata.Timestamp.Kind.Should().Be(DateTimeKind.Utc);
SnapshotStore.Tell(new SaveSnapshot(metadata, persistentFSMSnapshot), probe.Ref);
probe.ExpectMsg<SaveSnapshotSuccess>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,16 @@ public async Task MultipleSnapshotsWithSameSeqNo()
var snapshotStore = persistence.SnapshotStoreFor(null);
var snap = new TestPayload(SenderProbe.Ref);

var metadata = new SnapshotMetadata(PersistenceId, 3, DateTime.Now);
var metadata = new SnapshotMetadata(PersistenceId, 3, DateTime.UtcNow);
metadata.Timestamp.Kind.Should().Be(DateTimeKind.Utc);
snapshotStore.Tell(new SaveSnapshot(metadata, snap), SenderProbe);
var success = await SenderProbe.ExpectMsgAsync<SaveSnapshotSuccess>(10.Minutes());
success.Metadata.PersistenceId.Should().Be(metadata.PersistenceId);
success.Metadata.Timestamp.Should().Be(metadata.Timestamp);
success.Metadata.SequenceNr.Should().Be(metadata.SequenceNr);

metadata = new SnapshotMetadata(PersistenceId, 3, DateTime.Now);
metadata = new SnapshotMetadata(PersistenceId, 3, DateTime.UtcNow);
metadata.Timestamp.Kind.Should().Be(DateTimeKind.Utc);
snapshotStore.Tell(new SaveSnapshot(metadata, 3), SenderProbe);
success = await SenderProbe.ExpectMsgAsync<SaveSnapshotSuccess>();
success.Metadata.PersistenceId.Should().Be(metadata.PersistenceId);
Expand Down
9 changes: 6 additions & 3 deletions src/core/Akka.Persistence.TCK/Snapshot/SnapshotStoreSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ private IEnumerable<SnapshotMetadata> WriteSnapshots()
{
for (int i = 1; i <= 5; i++)
{
var metadata = new SnapshotMetadata(Pid, i + 10, Sys.Scheduler.Now.DateTime);
var metadata = new SnapshotMetadata(Pid, i + 10, Sys.Scheduler.DateTimeNow);
metadata.Timestamp.Kind.Should().Be(DateTimeKind.Utc);
SnapshotStore.Tell(new SaveSnapshot(metadata, $"s-{i}"), _senderProbe.Ref);
yield return _senderProbe.ExpectMsg<SaveSnapshotSuccess>().Metadata;
}
Expand Down Expand Up @@ -312,7 +313,8 @@ public virtual void SnapshotStore_should_save_and_overwrite_snapshot_with_same_s
[Fact]
public virtual void SnapshotStore_should_save_bigger_size_snapshot()
{
var metadata = new SnapshotMetadata(Pid, 100, Sys.Scheduler.Now.DateTime);
var metadata = new SnapshotMetadata(Pid, 100, Sys.Scheduler.DateTimeNow);
metadata.Timestamp.Kind.Should().Be(DateTimeKind.Utc);
var bigSnapshot = new byte[SnapshotByteSizeLimit];
new Random().NextBytes(bigSnapshot);
SnapshotStore.Tell(new SaveSnapshot(metadata, bigSnapshot), _senderProbe.Ref);
Expand All @@ -326,7 +328,8 @@ public virtual void ShouldSerializeSnapshots()
if (!SupportsSerialization) return;

var probe = CreateTestProbe();
var metadata = new SnapshotMetadata(Pid, 100L, Sys.Scheduler.Now.DateTime);
var metadata = new SnapshotMetadata(Pid, 100L, Sys.Scheduler.DateTimeNow);
metadata.Timestamp.Kind.Should().Be(DateTimeKind.Utc);
var snap = new TestPayload(probe.Ref);

SnapshotStore.Tell(new SaveSnapshot(metadata, snap), _senderProbe.Ref);
Expand Down

0 comments on commit 6deb2a2

Please sign in to comment.