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

v1.4.11 Production Release #4607

Merged
merged 33 commits into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8d5291d
Added v1.4.11 placeholder for nightly releases
Aaronontheweb Aug 20, 2020
5014dc3
updated common.props (#4549)
Aaronontheweb Aug 21, 2020
e55c42a
Bump Microsoft.NET.Test.Sdk from 16.7.0 to 16.7.1 (#4550)
dependabot-preview[bot] Aug 21, 2020
ebe5fd9
Re-enable Akka.Streams.Tests.TCK NUnit tests (#4548)
Arkatufus Aug 21, 2020
920497e
Update PersistenceIds query documentation to reflect the current fix …
Arkatufus Aug 21, 2020
65f3044
Add circuit breaker exponential backoff support (#4350)
ismaelhamed Aug 22, 2020
813c24f
Update index.md (#4554)
Gcaya Aug 24, 2020
a4c0fd9
Fix bug in BatchingSqlJournal CurrentAllEvents and AllEventsPublisher…
Arkatufus Aug 24, 2020
2064fbd
Fix race condition in GroupedWithin. (#4555)
Arkatufus Aug 25, 2020
367f5c5
Fix premature reset of the 'writeInProgress' flag in case of persiste…
ismaelhamed Aug 26, 2020
ea979ad
Marked SelectAllEventsAsync as virtual for plugins to override (#4557)
ismaelhamed Aug 26, 2020
9dfbb54
Remove NetFrameworkLibVersion support (#4559)
huysentruitw Sep 7, 2020
ea881a7
Add additional tests in `JournalPerfSpec` to help measure scaling cap…
to11mtm Sep 7, 2020
f52eff4
Remove UNSAFE_THREADING blocks (#4561)
huysentruitw Sep 9, 2020
362a446
Log TypeName in ShardRegion logs (#4562)
ismaelhamed Sep 9, 2020
a9f8db7
Added Virtual property `AllocatesAllPersistenceIDsPublisher` and make…
to11mtm Sep 10, 2020
8c3e49d
Avoid stuck rebalances during coordinator leaving (#4566)
ismaelhamed Sep 10, 2020
8c5d6cc
Bump Microsoft.Data.SQLite from 3.1.7 to 3.1.8 (#4564)
dependabot-preview[bot] Sep 10, 2020
8b1d54b
Bring ShardedDaemonProcess up to date (#4571)
ismaelhamed Oct 5, 2020
a80ddd7
Port scala akka PR #26816 to Akka.NET (#4511)
Arkatufus Oct 6, 2020
a706ee6
Fix ToString for KeepOldest strategy (#4572)
pirrmann Oct 9, 2020
80b9cac
Fix time in AtLeastOnceDeliverySemantic.SetDeliverySnapshot to be con…
ismaelhamed Oct 12, 2020
a9c60f3
Fix typo in cluster.conf (#4576)
pirrmann Oct 14, 2020
88f3568
NuGet: serve Akka.NET logo over HTTPS (#4582)
Aaronontheweb Oct 15, 2020
7fd6695
Bump Microsoft.Data.SQLite from 3.1.8 to 3.1.9 (#4578)
dependabot-preview[bot] Oct 15, 2020
22d313b
Bump FSharp.Core from 4.7.2 to 5.0.0 (#4586)
dependabot-preview[bot] Oct 20, 2020
b9ce185
* Add app-version to the Member information, (Migrated from https://g…
zbynek001 Oct 27, 2020
d3f457d
Fix ByteString.Empty throws when ToArray was called (#4593)
Arkatufus Oct 28, 2020
3705c8c
Api/rename app version (#4595)
Aaronontheweb Oct 29, 2020
59e149d
Double wildcard implementation for ActorSelection (#4375)
Arkatufus Oct 30, 2020
f628ba9
disseminate downing decisions faster (Migrated from https://github.c…
zbynek001 Nov 3, 2020
ad8c0d1
Fix TestKitBase and Option<T> (#4603)
Arkatufus Nov 4, 2020
b1481bc
added Akka.NET v1.4.11 release notes (#4606)
Aaronontheweb Nov 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
#### 1.4.10 August 20th 2020 ####
#### 1.4.11 November 5 2020 ####
**Maintenance Release for Akka.NET 1.4**

Akka.NET v1.4.11 includes some significant additions to Akka.NET:

* [Akka: How prevent "Scheduled sending of heartbeat was delayed" and occasionally network partitions](https://github.com/akkadotnet/akka.net/issues/4432) - all `/system` actors now run on a dedicated dispatcher. This should significantly improve reliablity for Akka.Cluster, Akka.Persistence, and other built-in Akka.NET systems inside heavily utilized environments.
* [Akka: Double wildcard implementation for ActorSelection](https://github.com/akkadotnet/akka.net/pull/4375)
* [Akka.Remote: Null reference exception due to RemoteActorRefProvider.RemoteInternals](https://github.com/akkadotnet/akka.net/issues/4579)
* [Akka.Persistence: Fix premature reset of the 'writeInProgress' flag in case of persistence failure](https://github.com/akkadotnet/akka.net/pull/4556)
* [Akka.Cluster: disseminate downing decisions faste](https://github.com/akkadotnet/akka.net/pull/4598)
* [Cluster - Add app-version to the Member information](https://github.com/akkadotnet/akka.net/pull/4577) - you can now specify which version of your software is running on each node.
* [Akka.Cluster.Sharding: Bring ShardedDaemonProcess up to date](https://github.com/akkadotnet/akka.net/pull/4571)

To see the [full set of fixes in Akka.NET v1.4.11, please see the milestone on Github](https://github.com/akkadotnet/akka.net/milestone/42).

| COMMITS | LOC+ | LOC- | AUTHOR |
| --- | --- | --- | --- |
| 8 | 1020 | 164 | Gregorius Soedharmo |
| 7 | 399 | 178 | Ismael Hamed |
| 4 | 5 | 5 | dependabot-preview[bot] |
| 4 | 108 | 104 | Aaron Stannard |
| 2 | 232 | 26 | to11mtm |
| 2 | 2 | 2 | Pierre Irrmann |
| 2 | 1969 | 269 | zbynek001 |
| 2 | 155 | 445 | huysentruitw |
| 1 | 1 | 1 | Guillaume Caya-Letourneau |

#### 1.4.10 August 20 2020 ####
**Maintenance Release for Akka.NET 1.4**

Akka.NET v1.4.10 includes some minor bug fixes and some major feature additions to Akka.Persistence.Query:
Expand Down
161 changes: 82 additions & 79 deletions build.fsx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $DotNetVersion = "3.1.105";
$DotNetInstallerUri = "https://dot.net/v1/dotnet-install.ps1";
$NugetVersion = "4.3.0";
$NugetUrl = "https://dist.nuget.org/win-x86-commandline/v$NugetVersion/nuget.exe"
$ProtobufVersion = "3.4.0"
$ProtobufVersion = "3.13.0"
$DocfxVersion = "2.48.1"

$IncrementalistVersion = "0.2.2";
Expand Down
8 changes: 8 additions & 0 deletions docs/articles/actors/dispatchers.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ system.ActorOf(Props.Create<MyActor>().WithDispatcher("my-dispatcher"), "my-acto
Some dispatcher configurations are available out-of-the-box for convenience. You can use them during actor deployment, [as described above](#configuring-dispatchers).

* **default-dispatcher** - A configuration that uses the [ThreadPoolDispatcher](#threadpooldispatcher). As the name says, this is the default dispatcher configuration used by the global dispatcher, and you don't need to define anything during deployment to use it.
* **internal-dispatcher** - To protect the internal Actors that is spawned by the various Akka modules, a separate internal dispatcher is used by default.
* **task-dispatcher** - A configuration that uses the [TaskDispatcher](#taskdispatcher).
* **default-fork-join-dispatcher** - A configuration that uses the [ForkJoinDispatcher](#forkjoindispatcher).
* **synchronized-dispatcher** - A configuration that uses the [SynchronizedDispatcher](#synchronizeddispatcher).
Expand Down Expand Up @@ -174,3 +175,10 @@ The following configuration keys are available for any dispatcher configuration:

> [!NOTE]
> The throughput-deadline-time is used as a *best effort*, not as a *hard limit*. This means that if a message takes more time than the deadline allows, Akka.NET won't interrupt the process. Instead it will wait for it to finish before giving turn to the next actor.

## Dispatcher aliases

When a dispatcher is looked up, and the given setting contains a string rather than a dispatcher config block,
the lookup will treat it as an alias, and follow that string to an alternate location for a dispatcher config.
If the dispatcher config is referenced both through an alias and through the absolute path only one dispatcher will
be used and shared among the two ids.
4 changes: 2 additions & 2 deletions docs/articles/persistence/persistence-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The predefined queries are:

**AllPersistenceIdsQuery (PersistentIds) and CurrentPersistenceIdsQuery**

`AllPersistenceIds`, or `PersistenceIds` in `IPersistenceIdsQuery`, is used to retrieve all cached persistenceIds of all persistent actors inside the `ActorSystem` where the journal actor is instantiated. Note that since this is a cached value, this query will only report `PersistentIds` that passed to the journal since the journal creation time (local cache).
`AllPersistenceIds` or `PersistenceIds`, and `CurrentPersistenceIds` in `IPersistenceIdsQuery` is used for retrieving all persistenceIds of all persistent actors.

```csharp
var queries = PersistenceQuery.Get(actorSystem)
Expand All @@ -64,7 +64,7 @@ The returned event stream is unordered and you can expect different order for mu

The stream is not completed when it reaches the end of the currently used `PersistenceIds`, but it continues to push new `PersistenceIds` when new persistent actors are created. Corresponding query that is completed when it reaches the end of the currently used `PersistenceIds` is provided by `CurrentPersistenceIds`.

The write journal is notifying the query side as soon as new `PersistenceIds` are created and there is no periodic polling or batching involved in this query.
Periodic polling of new `PersistenceIds` are done on the query side by retrieving the events in batches that sometimes can be delayed up to the configured `refresh-interval` or given `RefreshInterval` hint.

The stream is completed with failure if there is a failure in executing the query in the backend journal.

Expand Down
2 changes: 1 addition & 1 deletion docs/articles/remoting/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ akka {
See [Akka Remote Reference Config File](https://github.com/akkadotnet/akka.net/blob/dev/src/core/Akka.Remote/Configuration/Remote.conf) for additional information on HOCON settings available in akka remote.

## Addresses, Transports, Endpoints, and Associations
In the above section we mentioned that you have to bind a *transport* to an IP address and port, we did in that in HOCON inside the `dot-netty.tcp` section. Why did we have to do any of that?
In the above section we mentioned that you have to bind a *transport* to an IP address and port, we did that in HOCON inside the `dot-netty.tcp` section. Why did we have to do any of that?

Well, let's take a step back to define some key terms you'll need to be familiar with in order to use Akka.Remote:

Expand Down
27 changes: 11 additions & 16 deletions docs/articles/utilities/circuit-breaker.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,20 @@ The Akka.NET library provides an implementation of a circuit breaker called `Akk
## What do they do?

* During normal operation, a circuit breaker is in the `Closed` state:
* Exceptions or calls exceeding the configured `СallTimeout` increment a
failure counter
* Successes reset the failure count to zero
* When the failure counter reaches a `MaxFailures` count, the breaker is
tripped into `Open` state
* Exceptions or calls exceeding the configured `СallTimeout` increment a failure counter
* Successes reset the failure count to zero
* When the failure counter reaches a `MaxFailures` count, the breaker is tripped into `Open` state
* While in `Open` state:
* All calls fail-fast with a `OpenCircuitException`
* After the configured `ResetTimeout`, the circuit breaker enters a
`Half-Open` state
* All calls fail-fast with a `OpenCircuitException`
* After the configured `ResetTimeout`, the circuit breaker enters a `Half-Open` state
* In `Half-Open` state:
* The first call attempted is allowed through without failing fast
* All other calls fail-fast with an exception just as in `Open` state
* If the first call succeeds, the breaker is reset back to `Closed` state
* If the first call fails, the breaker is tripped again into the `Open` state
for another full `ResetTimeout`
* The first call attempted is allowed through without failing fast
* All other calls fail-fast with an exception just as in `Open` state
* If the first call succeeds, the breaker is reset back to `Closed` state and the `ResetTimeout` is reset
* If the first call fails, the breaker is tripped again into the `Open` state (as for exponential backoff circuit breaker, the `ResetTimeout` is multiplied by the exponential backoff factor)
* State transition listeners:
* Callbacks can be provided for every state entry via `OnOpen`, `OnClose`,
and `OnHalfOpen`
* These are executed in the `ExecutionContext` provided.
* Callbacks can be provided for every state entry via `OnOpen`, `OnClose`, and `OnHalfOpen`
* These are executed in the `ExecutionContext` provided.

![Circuit breaker states](/images/circuit-breaker-states.png)

Expand Down
29 changes: 24 additions & 5 deletions src/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@
<PropertyGroup>
<Copyright>Copyright © 2013-2020 Akka.NET Team</Copyright>
<Authors>Akka.NET Team</Authors>
<VersionPrefix>1.4.8</VersionPrefix>
<PackageIconUrl>http://getakka.net/images/akkalogo.png</PackageIconUrl>
<VersionPrefix>1.4.11</VersionPrefix>
<PackageIconUrl>https://getakka.net/images/akkalogo.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/akkadotnet/akka.net</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/akkadotnet/akka.net/blob/master/LICENSE</PackageLicenseUrl>
<NoWarn>$(NoWarn);CS1591;xUnit1013</NoWarn>
</PropertyGroup>
<PropertyGroup>
<XunitVersion>2.4.1</XunitVersion>
<TestSdkVersion>16.7.0</TestSdkVersion>
<TestSdkVersion>16.7.1</TestSdkVersion>
<HyperionVersion>0.9.16</HyperionVersion>
<NewtonsoftJsonVersion>12.0.3</NewtonsoftJsonVersion>
<NBenchVersion>2.0.1</NBenchVersion>
<ProtobufVersion>3.13.0</ProtobufVersion>
<NetCoreTestVersion>netcoreapp3.1</NetCoreTestVersion>
<NetFrameworkTestVersion>net461</NetFrameworkTestVersion>
<NetStandardLibVersion>netstandard2.0</NetStandardLibVersion>
<NetFrameworkLibVersion>net452</NetFrameworkLibVersion>
<FluentAssertionsVersion>4.14.0</FluentAssertionsVersion>
<FsCheckVersion>2.14.3</FsCheckVersion>
<HoconVersion>2.0.3</HoconVersion>
Expand All @@ -29,7 +28,27 @@
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<PropertyGroup>
<PackageReleaseNotes>Placeholder for nightlies**</PackageReleaseNotes>
<PackageReleaseNotes>Maintenance Release for Akka.NET 1.4**
Akka.NET v1.4.11 includes some significant additions to Akka.NET:
[Akka: How prevent "Scheduled sending of heartbeat was delayed" and occasionally network partitions](https://github.com/akkadotnet/akka.net/issues/4432) - all `/system` actors now run on a dedicated dispatcher. This should significantly improve reliablity for Akka.Cluster, Akka.Persistence, and other built-in Akka.NET systems inside heavily utilized environments.
[Akka: Double wildcard implementation for ActorSelection](https://github.com/akkadotnet/akka.net/pull/4375)
[Akka.Remote: Null reference exception due to RemoteActorRefProvider.RemoteInternals](https://github.com/akkadotnet/akka.net/issues/4579)
[Akka.Persistence: Fix premature reset of the 'writeInProgress' flag in case of persistence failure](https://github.com/akkadotnet/akka.net/pull/4556)
[Akka.Cluster: disseminate downing decisions faste](https://github.com/akkadotnet/akka.net/pull/4598)
[Cluster - Add app-version to the Member information](https://github.com/akkadotnet/akka.net/pull/4577) - you can now specify which version of your software is running on each node.
[Akka.Cluster.Sharding: Bring ShardedDaemonProcess up to date](https://github.com/akkadotnet/akka.net/pull/4571)
To see the [full set of fixes in Akka.NET v1.4.11, please see the milestone on Github](https://github.com/akkadotnet/akka.net/milestone/42).
| COMMITS | LOC+ | LOC- | AUTHOR |
| --- | --- | --- | --- |
| 8 | 1020 | 164 | Gregorius Soedharmo |
| 7 | 399 | 178 | Ismael Hamed |
| 4 | 5 | 5 | dependabot-preview[bot] |
| 4 | 108 | 104 | Aaron Stannard |
| 2 | 232 | 26 | to11mtm |
| 2 | 2 | 2 | Pierre Irrmann |
| 2 | 1969 | 269 | zbynek001 |
| 2 | 155 | 445 | huysentruitw |
| 1 | 1 | 1 | Guillaume Caya-Letourneau |</PackageReleaseNotes>
</PropertyGroup>
<!-- SourceLink support for all Akka.NET projects -->
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,14 @@
<PropertyGroup>
<AssemblyTitle>Akka.Cluster.Metrics</AssemblyTitle>
<Description>
The member nodes of the cluster can collect system health metrics and publish that to other cluster nodes
The member nodes of the cluster can collect system health metrics and publish that to other cluster nodes
and to the registered subscribers on the system event bus with the help of Cluster Metrics Extension.
</Description>
<TargetFramework>$(NetStandardLibVersion)</TargetFramework>
<PackageTags>$(AkkaPackageTags);network;cluster;sharding</PackageTags>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == '$(NetFrameworkLibVersion)' ">
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\core\Akka.Cluster\Akka.Cluster.csproj" />
</ItemGroup>
Expand All @@ -34,4 +28,4 @@
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
</PropertyGroup>

</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void ShardedDaemonProcess_Should_Init_Actor_Set()

var probe = CreateTestProbe();
ShardedDaemonProcess.Get(Sys).Init("the-fearless", 4, id => ProcessActor.Props(id, probe.Ref));
EnterBarrier("actor-set-initialized");
EnterBarrier("sharded-daemon-process-initialized");

RunOn(() =>
{
Expand All @@ -87,7 +87,7 @@ public void ShardedDaemonProcess_Should_Init_Actor_Set()
}).ToList();
startedIds.Count.Should().Be(4);
}, _config.First);
EnterBarrier("actor-set-started");
EnterBarrier("sharded-daemon-process-started");
}

private void FormCluster(RoleName first, params RoleName[] rest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public void ShardedDaemonProcess_must_start_N_actors_with_unique_ids()

var started = probe.ReceiveN(5);
started.Count.ShouldBe(5);
probe.ExpectNoMsg();
}

[Fact]
Expand All @@ -123,7 +124,7 @@ public void ShardedDaemonProcess_must_not_run_if_the_role_does_not_match_node_ro
Cluster.Get(Sys).Join(Cluster.Get(Sys).SelfAddress);

var probe = CreateTestProbe();
var settings = ShardedDaemonProcessSettings.Create(Sys).WithShardingSettings(ClusterShardingSettings.Create(Sys).WithRole("workers"));
var settings = ShardedDaemonProcessSettings.Create(Sys).WithRole("workers");
ShardedDaemonProcess.Get(Sys).Init("roles", 3, id => MyActor.Props(id, probe.Ref), settings);

probe.ExpectNoMsg();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@
<ProjectReference Include="..\Akka.DistributedData\Akka.DistributedData.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == '$(NetFrameworkLibVersion)' ">
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == '$(NetFrameworkLibVersion)' ">
<DefineConstants>$(DefineConstants);SERIALIZATION</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == '$(NetStandardLibVersion)' ">
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
</PropertyGroup>
Expand All @@ -36,4 +26,4 @@
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
</PropertyGroup>

</Project>
</Project>
28 changes: 12 additions & 16 deletions src/contrib/cluster/Akka.Cluster.Sharding/ClusterSharding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public ClusterSharding(ExtendedActorSystem system)
{
var guardianName = system.Settings.Config.GetString("akka.cluster.sharding.guardian-name");
var dispatcher = system.Settings.Config.GetString("akka.cluster.sharding.use-dispatcher");
if (string.IsNullOrEmpty(dispatcher)) dispatcher = Dispatchers.DefaultDispatcherId;
if (string.IsNullOrEmpty(dispatcher)) dispatcher = Dispatchers.InternalDispatcherId;
return system.SystemActorOf(Props.Create(() => new ClusterShardingGuardian()).WithDispatcher(dispatcher), guardianName);
});
}
Expand Down Expand Up @@ -1253,15 +1253,9 @@ internal class RebalanceWorker : ActorBase, IWithTimers
/// <param name="from">TBD</param>
/// <param name="handOffTimeout">TBD</param>
/// <param name="regions">TBD</param>
/// <param name="shuttingDownRegions">TBD</param>
/// <returns>TBD</returns>
public static Props Props(string shard, IActorRef @from, TimeSpan handOffTimeout, IEnumerable<IActorRef> regions, IEnumerable<IActorRef> shuttingDownRegions)
{
if (shuttingDownRegions.Count() > regions.Count())
throw new ArgumentException($"'shuttingDownRegions' must be a subset of 'regions'.", nameof(shuttingDownRegions));

return Actor.Props.Create(() => new RebalanceWorker(shard, @from, handOffTimeout, regions, shuttingDownRegions));
}
public static Props Props(string shard, IActorRef @from, TimeSpan handOffTimeout, IEnumerable<IActorRef> regions) =>
Actor.Props.Create(() => new RebalanceWorker(shard, @from, handOffTimeout, regions));

private readonly ShardId _shard;
private readonly IActorRef _from;
Expand All @@ -1279,18 +1273,19 @@ public static Props Props(string shard, IActorRef @from, TimeSpan handOffTimeout
/// <param name="from">TBD</param>
/// <param name="handOffTimeout">TBD</param>
/// <param name="regions">TBD</param>
/// <param name="shuttingDownRegions">TBD</param>
public RebalanceWorker(string shard, IActorRef @from, TimeSpan handOffTimeout, IEnumerable<IActorRef> regions, IEnumerable<IActorRef> shuttingDownRegions)
public RebalanceWorker(string shard, IActorRef @from, TimeSpan handOffTimeout, IEnumerable<IActorRef> regions)
{
_shard = shard;
_from = @from;

foreach (var region in shuttingDownRegions)
Context.Watch(region);

_remaining = new HashSet<IActorRef>(regions);
foreach (var region in _remaining)
{
Context.Watch(region);
region.Tell(new PersistentShardCoordinator.BeginHandOff(shard));
}

Log.Debug("Rebalance [{0}] from region [{1}]", shard, regions);

Timers.StartSingleTimer("hand-off-timeout", ReceiveTimeout.Instance, handOffTimeout);
}
Expand All @@ -1305,14 +1300,15 @@ protected override bool Receive(object message)
switch (message)
{
case PersistentShardCoordinator.BeginHandOffAck hoa when _shard == hoa.Shard:
Log.Debug("BeginHandOffAck for shard [{0}] received from {1}.", _shard, Sender);
Log.Debug("BeginHandOffAck for shard [{0}] received from [{1}].", _shard, Sender);
Acked(Sender);
return true;
case Terminated t:
Log.Debug("ShardRegion {0} terminated while waiting for BeginHandOffAck for shard [{1}].", t.ActorRef, _shard);
Log.Debug("ShardRegion [{0}] terminated while waiting for BeginHandOffAck for shard [{1}].", t.ActorRef, _shard);
Acked(t.ActorRef);
return true;
case ReceiveTimeout _:
Log.Debug("Rebalance of [{0}] from [{1}] timed out", _shard, _from);
Done(false);
return true;
}
Expand Down
Loading