-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* pass `Akka.Cluster.Cluster` into `IDowningProvider` directly close #5962 * enhanced `StartupWithOneThreadSpec` to include SBR * C#-ified HOCON * added #5962 repro * fixed `AutoDown` * fixed other `IDowningProvider` instances * updated Akka.Cluster API approvals
- Loading branch information
1 parent
67f6737
commit 9260924
Showing
11 changed files
with
155 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// //----------------------------------------------------------------------- | ||
// // <copyright file="Bugfix5962Spec.cs" company="Akka.NET Project"> | ||
// // Copyright (C) 2009-2022 Lightbend Inc. <http://www.lightbend.com> | ||
// // Copyright (C) 2013-2022 .NET Foundation <https://github.com/akkadotnet/akka.net> | ||
// // </copyright> | ||
// //----------------------------------------------------------------------- | ||
|
||
using System; | ||
using System.Threading.Tasks; | ||
using Akka.Configuration; | ||
using Akka.TestKit; | ||
using FluentAssertions; | ||
using FluentAssertions.Extensions; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
using static FluentAssertions.FluentActions; | ||
|
||
|
||
namespace Akka.Cluster.Tests | ||
{ | ||
public class Bugfix5962Spec : TestKit.Xunit2.TestKit | ||
{ | ||
private static readonly Config Config = ConfigurationFactory.ParseString(@" | ||
akka { | ||
loglevel = INFO | ||
actor { | ||
provider = cluster | ||
default-dispatcher = { | ||
executor = channel-executor | ||
channel-executor.priority = normal | ||
} | ||
# Adding this part in combination with the SplitBrainResolverProvider causes the error | ||
internal-dispatcher = { | ||
executor = channel-executor | ||
channel-executor.priority = high | ||
} | ||
} | ||
remote { | ||
dot-netty.tcp { | ||
port = 15508 | ||
hostname = ""127.0.0.1"" | ||
} | ||
default-remote-dispatcher { | ||
executor = channel-executor | ||
channel-executor.priority = high | ||
} | ||
backoff-remote-dispatcher { | ||
executor = channel-executor | ||
channel-executor.priority = low | ||
} | ||
} | ||
cluster { | ||
seed-nodes = [""akka.tcp://Bugfix5962Spec@127.0.0.1:15508""] | ||
downing-provider-class = ""Akka.Cluster.SBR.SplitBrainResolverProvider, Akka.Cluster"" | ||
} | ||
}"); | ||
|
||
private readonly Type _timerMsgType; | ||
|
||
public Bugfix5962Spec(ITestOutputHelper output): base(Config, nameof(Bugfix5962Spec), output) | ||
{ | ||
_timerMsgType = Type.GetType("Akka.Actor.Scheduler.TimerScheduler+TimerMsg, Akka"); | ||
} | ||
|
||
[Fact] | ||
public async Task SBR_Should_work_with_channel_executor() | ||
{ | ||
var latch = new TestLatch(1); | ||
var cluster = Cluster.Get(Sys); | ||
cluster.RegisterOnMemberUp(() => | ||
{ | ||
latch.CountDown(); | ||
}); | ||
|
||
var selection = Sys.ActorSelection("akka://Bugfix5962Spec/system/cluster/core/daemon/downingProvider"); | ||
|
||
await Awaiting(() => selection.ResolveOne(1.Seconds())) | ||
.Should().NotThrowAsync("Downing provider should be alive. ActorSelection will throw an ActorNotFoundException if this fails"); | ||
|
||
// There should be no TimerMsg being sent to dead letter, this signals that the downing provider is dead | ||
await EventFilter.DeadLetter(_timerMsgType).ExpectAsync(0, async () => | ||
{ | ||
latch.Ready(1.Seconds()); | ||
await Task.Delay(2.Seconds()); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.