Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should handle subscriptions in any state #15

Merged
merged 8 commits into from
Mar 8, 2019
Merged

Should handle subscriptions in any state #15

merged 8 commits into from
Mar 8, 2019

Conversation

izavala
Copy link
Contributor

@izavala izavala commented Mar 8, 2019

#13

@Aaronontheweb
Copy link
Member

[INFO][3/8/2019 7:40:11 PM][Thread 0009][[akka://test/user/$a#1722184184]] Persistence probe terminated. Recreating...
[WARNING][3/8/2019 7:40:11 PM][Thread 0016][akka://test/user/$a/$b] DeadLetter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562] to [akka://test/user/$a/$b#642758347]: <Received dead letter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562]: DeleteSnapshotsSuccess<SnapshotSelectionCriteria<maxSeqNr: 1, maxTimestamp: 9999/12/31, minSeqNr: 0, minTimestamp: 0001/01/01>>>
[WARNING][3/8/2019 7:40:11 PM][Thread 0016][akka://test/user/$a/$b] DeadLetter from [akka://test/deadLetters] to [akka://test/user/$a/$b#642758347]: <Received dead letter from [akka://test/deadLetters]: DeleteMessagesSuccess<toSequenceNr: 1>>
[INFO][3/8/2019 7:40:11 PM][Thread 0016][akka://test/user/$a/$b] Message DeleteSnapshotsSuccess from akka://test/system/akka.persistence.snapshot-store.local to akka://test/user/$a/$b was not delivered. 1 dead letters encountered.
[INFO][3/8/2019 7:40:11 PM][Thread 0016][akka://test/user/$a/$b] Message DeleteMessagesSuccess from akka://test/deadLetters to akka://test/user/$a/$b was not delivered. 2 dead letters encountered.
[WARNING][3/8/2019 7:40:11 PM][Thread 0016][akka://test/user/$a/$c] DeadLetter from [akka://test/deadLetters] to [akka://test/user/$a/$c#9033603]: <Received dead letter from [akka://test/deadLetters]: DeleteMessagesSuccess<toSequenceNr: 2>>
[INFO][3/8/2019 7:40:11 PM][Thread 0016][akka://test/user/$a/$c] Message DeleteMessagesSuccess from akka://test/deadLetters to akka://test/user/$a/$c was not delivered. 3 dead letters encountered.
[WARNING][3/8/2019 7:40:11 PM][Thread 0016][akka://test/user/$a/$c] DeadLetter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562] to [akka://test/user/$a/$c#9033603]: <Received dead letter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562]: DeleteSnapshotsSuccess<SnapshotSelectionCriteria<maxSeqNr: 2, maxTimestamp: 9999/12/31, minSeqNr: 0, minTimestamp: 0001/01/01>>>
[INFO][3/8/2019 7:40:11 PM][Thread 0016][akka://test/user/$a/$c] Message DeleteSnapshotsSuccess from akka://test/system/akka.persistence.snapshot-store.local to akka://test/user/$a/$c was not delivered. 4 dead letters encountered.
[WARNING][3/8/2019 7:40:12 PM][Thread 0028][akka://test/user/$a/$d] DeadLetter from [akka://test/deadLetters] to [akka://test/user/$a/$d#1640801739]: <Received dead letter from [akka://test/deadLetters]: DeleteMessagesSuccess<toSequenceNr: 3>>
[INFO][3/8/2019 7:40:12 PM][Thread 0028][akka://test/user/$a/$d] Message DeleteMessagesSuccess from akka://test/deadLetters to akka://test/user/$a/$d was not delivered. 5 dead letters encountered.
[WARNING][3/8/2019 7:40:12 PM][Thread 0009][akka://test/user/$a/$d] DeadLetter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562] to [akka://test/user/$a/$d#1640801739]: <Received dead letter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562]: DeleteSnapshotsSuccess<SnapshotSelectionCriteria<maxSeqNr: 3, maxTimestamp: 9999/12/31, minSeqNr: 0, minTimestamp: 0001/01/01>>>
[INFO][3/8/2019 7:40:12 PM][Thread 0009][akka://test/user/$a/$d] Message DeleteSnapshotsSuccess from akka://test/system/akka.persistence.snapshot-store.local to akka://test/user/$a/$d was not delivered. 6 dead letters encountered.
Passed AkkaPersistenceLivenessProbeProviderSettingsTest_Should_Load
[WARNING][3/8/2019 7:40:12 PM][Thread 0009][akka://test/user/$a/$e] DeadLetter from [akka://test/deadLetters] to [akka://test/user/$a/$e#8767287]: <Received dead letter from [akka://test/deadLetters]: DeleteMessagesSuccess<toSequenceNr: 4>>
[INFO][3/8/2019 7:40:12 PM][Thread 0009][akka://test/user/$a/$e] Message DeleteMessagesSuccess from akka://test/deadLetters to akka://test/user/$a/$e was not delivered. 7 dead letters encountered.
[WARNING][3/8/2019 7:40:12 PM][Thread 0016][akka://test/user/$a/$e] DeadLetter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562] to [akka://test/user/$a/$e#8767287]: <Received dead letter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562]: DeleteSnapshotsSuccess<SnapshotSelectionCriteria<maxSeqNr: 4, maxTimestamp: 9999/12/31, minSeqNr: 0, minTimestamp: 0001/01/01>>>
[INFO][3/8/2019 7:40:12 PM][Thread 0016][akka://test/user/$a/$e] Message DeleteSnapshotsSuccess from akka://test/system/akka.persistence.snapshot-store.local to akka://test/user/$a/$e was not delivered. 8 dead letters encountered.
[WARNING][3/8/2019 7:40:12 PM][Thread 0016][akka://test/user/$a/$f] DeadLetter from [akka://test/deadLetters] to [akka://test/user/$a/$f#1435363035]: <Received dead letter from [akka://test/deadLetters]: DeleteMessagesSuccess<toSequenceNr: 5>>
[INFO][3/8/2019 7:40:12 PM][Thread 0016][akka://test/user/$a/$f] Message DeleteMessagesSuccess from akka://test/deadLetters to akka://test/user/$a/$f was not delivered. 9 dead letters encountered.
[WARNING][3/8/2019 7:40:12 PM][Thread 0028][akka://test/user/$a/$f] DeadLetter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562] to [akka://test/user/$a/$f#1435363035]: <Received dead letter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562]: DeleteSnapshotsSuccess<SnapshotSelectionCriteria<maxSeqNr: 5, maxTimestamp: 9999/12/31, minSeqNr: 0, minTimestamp: 0001/01/01>>>
[WARNING][3/8/2019 7:40:12 PM][Thread 0009][akka://test/user/$a/$g] DeadLetter from [akka://test/deadLetters] to [akka://test/user/$a/$g#291395346]: <Received dead letter from [akka://test/deadLetters]: DeleteMessagesSuccess<toSequenceNr: 6>>
[WARNING][3/8/2019 7:40:12 PM][Thread 0016][akka://test/user/$a/$g] DeadLetter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562] to [akka://test/user/$a/$g#291395346]: <Received dead letter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562]: DeleteSnapshotsSuccess<SnapshotSelectionCriteria<maxSeqNr: 6, maxTimestamp: 9999/12/31, minSeqNr: 0, minTimestamp: 0001/01/01>>>
[WARNING][3/8/2019 7:40:13 PM][Thread 0028][akka://test/user/$a/$h] DeadLetter from [akka://test/deadLetters] to [akka://test/user/$a/$h#838688144]: <Received dead letter from [akka://test/deadLetters]: DeleteMessagesSuccess<toSequenceNr: 7>>
[WARNING][3/8/2019 7:40:13 PM][Thread 0028][akka://test/user/$a/$h] DeadLetter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562] to [akka://test/user/$a/$h#838688144]: <Received dead letter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562]: DeleteSnapshotsSuccess<SnapshotSelectionCriteria<maxSeqNr: 7, maxTimestamp: 9999/12/31, minSeqNr: 0, minTimestamp: 0001/01/01>>>
[WARNING][3/8/2019 7:40:13 PM][Thread 0028][akka://test/user/$a/$i] DeadLetter from [akka://test/deadLetters] to [akka://test/user/$a/$i#1510098882]: <Received dead letter from [akka://test/deadLetters]: DeleteMessagesSuccess<toSequenceNr: 8>>
[WARNING][3/8/2019 7:40:13 PM][Thread 0028][akka://test/user/$a/$i] DeadLetter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562] to [akka://test/user/$a/$i#1510098882]: <Received dead letter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562]: DeleteSnapshotsSuccess<SnapshotSelectionCriteria<maxSeqNr: 8, maxTimestamp: 9999/12/31, minSeqNr: 0, minTimestamp: 0001/01/01>>>
[WARNING][3/8/2019 7:40:13 PM][Thread 0016][akka://test/user/$a/$j] DeadLetter from [akka://test/deadLetters] to [akka://test/user/$a/$j#1360937719]: <Received dead letter from [akka://test/deadLetters]: DeleteMessagesSuccess<toSequenceNr: 9>>
[WARNING][3/8/2019 7:40:13 PM][Thread 0028][akka://test/user/$a/$j] DeadLetter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562] to [akka://test/user/$a/$j#1360937719]: <Received dead letter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562]: DeleteSnapshotsSuccess<SnapshotSelectionCriteria<maxSeqNr: 9, maxTimestamp: 9999/12/31, minSeqNr: 0, minTimestamp: 0001/01/01>>>
[WARNING][3/8/2019 7:40:14 PM][Thread 0009][akka://test/user/$a/$k] DeadLetter from [akka://test/deadLetters] to [akka://test/user/$a/$k#1130667106]: <Received dead letter from [akka://test/deadLetters]: DeleteMessagesSuccess<toSequenceNr: 10>>
[WARNING][3/8/2019 7:40:14 PM][Thread 0009][akka://test/user/$a/$k] DeadLetter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562] to [akka://test/user/$a/$k#1130667106]: <Received dead letter from [akka://test/system/akka.persistence.snapshot-store.local#1476684562]: DeleteSnapshotsSuccess<SnapshotSelectionCriteria<maxSeqNr: 10, maxTimestamp: 9999/12/31, minSeqNr: 0, minTimestamp: 0001/01/01>>>
[xUnit.net 00:00:06.16] AkkaPersistenceLivenessProbe_Should_Handle_Subscriptions_In_Any_State [FAIL]
[xUnit.net 00:00:06.16] Failed: Timeout 00:00:03 while waiting for a message of type Akka.HealthCheck.Liveness.LivenessStatus
[xUnit.net 00:00:06.16] Expected: True
[xUnit.net 00:00:06.16] Actual: False
[xUnit.net 00:00:06.16] Stack Trace:
[xUnit.net 00:00:06.16] at Akka.TestKit.TestKitBase.InternalExpectMsgEnvelope[T](Nullable1 timeout, Action2 assert, String hint, Boolean shouldLog)
[xUnit.net 00:00:06.16] at Akka.TestKit.TestKitBase.InternalExpectMsgEnvelope[T](Nullable1 timeout, Action1 msgAssert, Action1 senderAssert, String hint) [xUnit.net 00:00:06.16] at Akka.TestKit.TestKitBase.InternalExpectMsg[T](Nullable1 timeout, Action1 msgAssert, String hint) [xUnit.net 00:00:06.16] at Akka.TestKit.TestKitBase.ExpectMsg[T](Nullable1 duration, String hint)
[xUnit.net 00:00:06.16] D:\a\1\s\src\Akka.HealthCheck.Persistence.Tests\AkkaPersistenceLivenessProbeSubscriptionTest.cs(29,0): at Akka.HealthCheck.Persistence.Tests.AkkaPersistenceLivenessProbeSubscriptionTest.<AkkaPersistenceLivenessProbe_Should_Handle_Subscriptions_In_Any_State>b__1_1()
[xUnit.net 00:00:06.16] at Akka.TestKit.TestKitBase.AwaitAssert(Action assertion, Nullable1 duration, Nullable1 interval)
[xUnit.net 00:00:06.16] D:\a\1\s\src\Akka.HealthCheck.Persistence.Tests\AkkaPersistenceLivenessProbeSubscriptionTest.cs(34,0): at Akka.HealthCheck.Persistence.Tests.AkkaPersistenceLivenessProbeSubscriptionTest.AkkaPersistenceLivenessProbe_Should_Handle_Subscriptions_In_Any_State()
[xUnit.net 00:00:06.16] Output:
[xUnit.net 00:00:06.16] [INFO][3/8/2019 7:40:11 PM][Thread 0009][[akka://test/user/$a#1722184184]] Persistence probe terminated. Recreating...
[xUnit.net 00:00:06.16] [INFO][3/8/2019 7:40:11 PM][Thread 0016][akka://test/user/$a/$b] Message DeleteSnapshotsSuccess from akka://test/system/akka.persistence.snapshot-store.local to akka://test/user/$a/$b was not delivered. 1 dead letters encountered.
[xUnit.net 00:00:06.16] [INFO][3/8/2019 7:40:11 PM][Thread 0016][akka://test/user/$a/$b] Message DeleteMessagesSuccess from akka://test/deadLetters to akka://test/user/$a/$b was not delivered. 2 dead letters encountered.
[xUnit.net 00:00:06.16] [INFO][3/8/2019 7:40:11 PM][Thread 0016][akka://test/user/$a/$c] Message DeleteMessagesSuccess from akka://test/deadLetters to akka://test/user/$a/$c was not delivered. 3 dead letters encountered.
[xUnit.net 00:00:06.16] [INFO][3/8/2019 7:40:11 PM][Thread 0016][akka://test/user/$a/$c] Message DeleteSnapshotsSuccess from akka://test/system/akka.persistence.snapshot-store.local to akka://test/user/$a/$c was not delivered. 4 dead letters encountered.
[xUnit.net 00:00:06.16] [INFO][3/8/2019 7:40:12 PM][Thread 0028][akka://test/user/$a/$d] Message DeleteMessagesSuccess from akka://test/deadLetters to akka://test/user/$a/$d was not delivered. 5 dead letters encountered.
[xUnit.net 00:00:06.16] [INFO][3/8/2019 7:40:12 PM][Thread 0009][akka://test/user/$a/$d] Message DeleteSnapshotsSuccess from akka://test/system/akka.persistence.snapshot-store.local to akka://test/user/$a/$d was not delivered. 6 dead letters encountered.
[xUnit.net 00:00:06.16] [INFO][3/8/2019 7:40:12 PM][Thread 0009][akka://test/user/$a/$e] Message DeleteMessagesSuccess from akka://test/deadLetters to akka://test/user/$a/$e was not delivered. 7 dead letters encountered.
[xUnit.net 00:00:06.16] [INFO][3/8/2019 7:40:12 PM][Thread 0016][akka://test/user/$a/$e] Message DeleteSnapshotsSuccess from akka://test/system/akka.persistence.snapshot-store.local to akka://test/user/$a/$e was not delivered. 8 dead letters encountered.
[xUnit.net 00:00:06.16] [INFO][3/8/2019 7:40:12 PM][Thread 0016][akka://test/user/$a/$f] Message DeleteMessagesSuccess from akka://test/deadLetters to akka://test/user/$a/$f was not delivered. 9 dead letters encountered.
[xUnit.net 00:00:06.16] [DEBUG][3/8/2019 7:40:14 PM][Thread 0014][ActorSystem(test)] System shutdown initiated
[xUnit.net 00:00:06.16] Finished: Akka.HealthCheck.Persistence.Tests

@Aaronontheweb Aaronontheweb marked this pull request as ready for review March 8, 2019 19:53
Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicks and small changes

sqlite {
class = ""Akka.Persistence.Sqlite.Journal.SqliteJournal, Akka.Persistence.Sqlite""
auto-initialize = on
connection-string = """ + "Filename=file:memdb.db;Mode=Memory;Cache=Shared" + @"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, don't need to concatenate a string here - since the connection string itself is also a string.

sqlite {
class = ""Akka.Persistence.Sqlite.Snapshot.SqliteSnapshotStore, Akka.Persistence.Sqlite""
auto-initialize = on
connection-string = """ + "Filename=file:memdb.db;Mode=Memory;Cache=Shared" + @"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, don't need to concatenate a string here - since the connection string itself is also a string. Same feedback as above.

@@ -25,7 +25,7 @@ public AkkaPersistenceLivenessProbeProviderSettingsTest(ITestOutputHelper helper
}} }";


[Fact]
[Fact(DisplayName = "AkkaPersistenceLivenessProbeProviderSettingsTest_Should_Load")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider giving this a human-friendly name instead - that's how it'll show up in the test run results files.


<ItemGroup>
<PackageReference Include="akka.persistence.sqlite" Version="1.3.11" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the Version to read $(AkkaVersion) - that way we can synchronize on the Akka.NET version specific in common.props, just like how we do for the TestKit on the line below.

@@ -113,7 +122,14 @@ protected override void PreStart()
private void CreateProbe(bool firstTime)
{
_probe = Context.ActorOf(Props.Create(() => new AkkaPersistenceHealthCheckProbe(Self, firstTime)));
Context.System.Scheduler.ScheduleTellOnce(TimeSpan.FromSeconds(10), _probe, "hit" + _probeCounter++, Self);
if(firstTime)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


Command<SaveSnapshotSuccess>(save =>
{
if (!_firstAttempt)
{
DeleteMessages(LastSequenceNr - 1);
DeleteSnapshots(new SnapshotSelectionCriteria(save.Metadata.SequenceNr - 1));
DeleteMessages(save.Metadata.SequenceNr - 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -25,7 +25,7 @@ public AkkaPersistenceLivenessProbeProviderSettingsTest(ITestOutputHelper helper
}} }";


[Fact(DisplayName = "AkkaPersistenceLivenessProbeProviderSettingsTest_Should_Load")]
[Fact(DisplayName = "Should be able to load using hocon configuration")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be able to load PersistenceProvider ?

}
}}";
[Fact(DisplayName = "AkkaPersistenceLivenessProbe_Should_Handle_Subscriptions_In_Any_State")]
[Fact(DisplayName = "Should be able to accept a subsrcibe request in any state")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be able to subscribe to what?

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect

@Aaronontheweb Aaronontheweb merged commit 4e74eb7 into petabridge:dev Mar 8, 2019
@izavala izavala deleted the Should_Handle_Subscriptions_In_Any_State branch March 8, 2019 23:12
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants